Microsoft

GH-200 practice question 15

GitHub Actions · free question 15 of 20

Question

Which step is using the dbserver environment variable correctly?
  • A. steps: - name: Hello world run: echo $dbserver variables: dbserver: orgserver1
  • B. steps: - name: Hello world run: echo $dbserver env: - name: dbserver value: orgserver1
  • C. steps: - name: Hello world run: echo $dbserver environment: dbserver: orgserver1
  • D. steps: - name: Hello world run: echo $dbserver env: dbserver: orgserver1 Correct

Explanation

A step defines environment variables with the env key as a map of names to values, and the run command then reads it as $dbserver. Workflow steps have no variables key. A list of name and value pairs is Kubernetes or Azure Pipelines style, not GitHub Actions syntax. environment is a job-level key for deployment environments.

Practice the whole free set

Answer all 20 free GH-200 questions with instant feedback, or unlock all 106 questions with Learn and Exam modes.