GitHub Actions · infra · fg-0230
Passing env values to a reusable workflow fails with "Unrecognized named-value: 'env'"
Unrecognized named-value: 'env'. Located at position 1 within expression: env.IMAGE_TAG
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
The env context is not available in jobs.ID.with for a uses: call, which only allows github, needs, strategy, matrix, inputs, and vars. Workflow level env also does not flow into the called workflow.
Fix
Compute the value in an earlier job and pass it through needs outputs, or store constants in repository variables and use vars.
Apply
jobs:
prep:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.t.outputs.tag }}
steps:
- id: t
run: echo "tag=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
deploy:
needs: prep
uses: ./.github/workflows/deploy.yml
with:
image_tag: ${{ needs.prep.outputs.tag }}Affects: GitHub Actions reusable workflows, by design as of October 2026
Sources
- https://github.com/actions/runner/issues/2372
- https://docs.github.com/en/actions/reference/workflows-and-actions/contexts
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp