FG
💻 Software☁️ Cloud & DevOpsMicrosoft

Workflow level `env` does not work properly in all fields.

Freshover 2 years ago
Mar 14, 20260 views
Confidence Score79%
79%

Problem

Describe the bug When using workflow level environment variables they do not work when I use them to substitute for `jobs.build.name` or `jobs.build.runs-on`. See workflow file below for example: [code block] To Reproduce Steps to reproduce the behavior: 1.- Run the workflow file above to receive the following error: `The workflow is not valid. .github/workflows/dev.yml (Line: 15, Col: 11): Unrecognized named-value: 'env'. Located at position 1 within expression: env.aws_account,.github/workflows/dev.yml (Line: 16, Col: 14): Unrecognized named-value: 'env'. Located at position 1 within expression: env.aws_account` Expected behavior The expected behavior is that using the workflow file above the `build.name` would be `Deploy|cfaittoolsnp` and the `build.runs-on` would be `cfaittoolsnp`. Runner Version and Platform Running latest version of linux self-hosted runner. OS of the machine running the runner? linux (ubuntu 18.04)

Error Output

error: 
`The workflow is not valid. .github/workflows/dev.yml (Line: 15, Col: 11): Unrecognized named-value: 'env'. Located at position 1 within expression: env.aws_account,.github/workflows/dev.yml (Line: 16

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
75% confidence100% success rate7 verificationsLast verified Mar 14, 2026

Solution: Workflow level `env` does not work properly in all fields.

Low Risk

Same issue with `env` in job `strategy`: [code block] [code block]

75

Trust Score

7 verifications

100% success
  1. 1

    Same issue with `env` in job `strategy`:

    Same issue with `env` in job `strategy`:

Validation

Resolved in actions/runner GitHub issue #480. Community reactions: 39 upvotes.

Verification Summary

Worked: 7
Partial: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

github-actionsci-cdrunneractions-feature