Skip to content
Discussion options

You must be logged in to vote

What's the difference between env, secrets, and vars contexts in a workflow? Can a step access a secret from another job directly?

env vs secrets vs vars in GitHub Actions

Context What it holds Scope Where defined
env Plain-text variables you set inline Per-step, per-job, per-workflow, or per-environment env: key in YAML, or $GITHUB_ENV
secrets Encrypted values (passwords, tokens, API keys) Repository, environment, or organization GitHub UI, CLI, or REST API
vars Plain-text configuration variables (no encryption) Repository, environment, or organization GitHub UI, CLI, or REST API

Key distinctions:

  • env is ephemeral — defined in the workflow file itself or set during a run…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sudoUgando
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants