Skip to content
Latchkey

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 input

Common 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 input

Use env only when the action reads env

  1. Check the action’s docs: some actions intentionally read specific env vars.
  2. For everything else, map values to the action’s with: inputs.
  3. 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →