nerdexam
Microsoft

GH-200 · Question #76

What is the smallest scope for an environment variable?

The correct answer is D. a step. GitHub Actions supports environment variable scoping at three levels: workflow-level (env: at the top of the workflow file, available to all jobs and steps), job-level (env: under a job definition, available to all steps in that job), and step-level (env: under a specific step, a

Implement and manage GitHub Actions workflows

Question

What is the smallest scope for an environment variable?

Options

  • Athe workflow settings
  • Bthe workflow env mapping
  • Ca job
  • Da step

How the community answered

(18 responses)
  • A
    6% (1)
  • C
    6% (1)
  • D
    89% (16)

Explanation

GitHub Actions supports environment variable scoping at three levels: workflow-level (env: at the top of the workflow file, available to all jobs and steps), job-level (env: under a job definition, available to all steps in that job), and step-level (env: under a specific step, available only to that single step). The step is the smallest scope - an environment variable defined at the step level cannot be accessed by other steps or jobs. This scoping model allows precise control over variable visibility.

Topics

#Environment variables#Variable scope#GitHub Actions workflows

Community Discussion

No community discussion yet for this question.

Full GH-200 Practice