Question
What is the smallest scope for an environment variable?
- A. the workflow settings
- B. the workflow env mapping
- C. a job
- D. a step Correct
Explanation
Environment variables can be set in the workflow env mapping, in a job, or in a single step (jobs.<job_id>.steps[*].env). A variable defined in a step exists only for that step and overrides job-level and workflow-level variables with the same name, which makes the step the smallest scope. A job-level variable applies to every step in the job, and the workflow env mapping applies to all jobs.