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…
Question
Which step is using the dbserver environment variable correctly?
Options
- Asteps:
- Bsteps:
- Csteps:
- Dsteps:
How the community answered
(55 responses)- A4% (2)
- C2% (1)
- D95% (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
Community Discussion
No community discussion yet for this question.