GitHub Actions env on a uses: Step Is Ignored by the Action
An env block on a uses: step does not configure the action because most actions read their declared inputs via with:, not the step environment. The action sees its inputs, not your env var.
What this error means
Setting env on a uses: step has no effect on the action’s behavior, while the same value passed through with: works as expected.
.github/workflows/ci.yml
- uses: some/action@v1
env:
TOKEN: ${{ secrets.TOKEN }} # action does not read this as an inputCommon causes
Actions consume inputs, not step env
A JavaScript or composite action reads inputs declared in its action.yml (exposed as INPUT_* / inputs context). A plain env var on the step is not an input.
Confusing run-step env with action inputs
env works for run: steps because the shell reads it. A uses: step instead passes configuration through with:.
How to fix it
Pass configuration via with:
Use the action’s declared inputs under with: rather than env.
.github/workflows/ci.yml
- uses: some/action@v1
with:
token: ${{ secrets.TOKEN }} # declared inputUse env only when the action reads env
- Check the action’s docs: some actions intentionally read specific env vars.
- For everything else, map values to the action’s with: inputs.
- For run: steps, env is the right mechanism.
How to prevent it
- Pass action configuration through with:, not step env.
- Read each action’s documented inputs before wiring it up.
- Reserve step env for run: steps and documented env-reading actions.
Related guides
GitHub Actions env at Workflow vs Job vs Step - Wrong Value WinsFix GitHub Actions env variable scoping - workflow, job, and step env blocks override each other, and step-le…
GitHub Actions Composite Action Outputs Empty in the CallerFix GitHub Actions composite action outputs that arrive empty - outputs must be mapped in action.yml from a s…
GitHub Actions Composite Action Ignores working-directoryFix GitHub Actions composite action run steps ignoring working-directory - each composite step needs its own…