nerdexam
Microsoft

GH-200 · Question #73

Which step is using the dbserver environment variable correctly?

The correct answer is D. steps. Environment variables in GitHub Actions steps are referenced using the env context in expressions (${{ env.dbserver }}) or as shell variables ($dbserver) inside run scripts. The correct pattern is to define the variable under env: at the appropriate scope and then reference it…

Author and Maintain Workflows

Question

Which step is using the dbserver environment variable correctly?

Options

  • Asteps:
  • Bsteps:
  • Csteps:
  • Dsteps:

How the community answered

(55 responses)
  • A
    4% (2)
  • C
    2% (1)
  • D
    95% (52)

Explanation

Environment variables in GitHub Actions steps are referenced using the env context in expressions (${{ env.dbserver }}) or as shell variables ($dbserver) inside run scripts. The correct pattern is to define the variable under env: at the appropriate scope and then reference it consistently. Option D correctly declares dbserver under the step's env: mapping and references it with the proper syntax in the run command. The other options either define the variable at the wrong scope, reference it with incorrect syntax, or mix context types inappropriately.

Topics

#Environment Variables#GitHub Actions Workflow Syntax#Step Configuration#Shell Scripting

Community Discussion

No community discussion yet for this question.

Full GH-200 Practice