nerdexam
GitHub

GITHUB-ACTIONS · Question #22

Which scopes are available to define custom environment variables within a workflow file? (Choose three.)

The correct answer is A. the entire workflow, by using env at the top level of the workflow file D. within the run attribute of a job step F. a specific step within a job, by using jobs.<job_id>.steps[*].env. You can define environment variables for the entire workflow by using the env key at the top level of the workflow file. These environment variables will be available to all jobs and steps within the Environment variables can also be set within the run attribute of a job step, an

Use workflow components to automate software development lifecycle

Question

Which scopes are available to define custom environment variables within a workflow file? (Choose three.)

Options

  • Athe entire workflow, by using env at the top level of the workflow file
  • Ball jobs being run on a single Actions runner, by using runner.env at the top of the workflow file
  • Cthe entire stage, by using env at the top of the defined build stage
  • Dwithin the run attribute of a job step
  • Ethe contents of a job within a workflow, by using jobs.<job_id>.env
  • Fa specific step within a job, by using jobs.<job_id>.steps[*].env

How the community answered

(42 responses)
  • A
    93% (39)
  • C
    2% (1)
  • E
    5% (2)

Explanation

You can define environment variables for the entire workflow by using the env key at the top level of the workflow file. These environment variables will be available to all jobs and steps within the Environment variables can also be set within the run attribute of a job step, and these variables will be scoped only to that specific step. You can set environment variables for specific steps within a job by using jobs.<job_id>.steps[*].env, which allows you to define variables that will only be available to that

Topics

#environment variables#variable scoping#workflow syntax#env keyword

Community Discussion

No community discussion yet for this question.

Full GITHUB-ACTIONS Practice