GitHub Actions uses the env key to define environment variables. The env mapping can be applied at the workflow, job, or individual step level. In option B, dbserver is defined directly beneath the step-level env key, making it available to that step ' s shell process. Because the example uses shell syntax appropriate to a Linux runner, $dbserver correctly references the environment variable from the run command. The variables and environment keys shown in options A and D are not valid substitutes for step-level env. Option C also uses an invalid list structure; env expects a mapping of variable names to values rather than name and value objects. Therefore, option B uses the supported GitHub Actions workflow syntax.
================
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit