Microsoft

GH-200 practice question 13

GitHub Actions · free question 13 of 20

Question

Which of the following is the proper syntax to specify a custom environment variable named MY_VARIABLE with the value my-value?
  • A. var: MY_VARIABLE = my-value
  • B. environment: MY_VARIABLE = my-value
  • C. var: MY_VARIABLE: my-value
  • D. env: MY_VARIABLE = my-value
  • E. environment: MY_VARIABLE: my-value
  • F. env: MY_VARIABLE: my-value Correct

Explanation

Custom environment variables are set with the env key as a YAML map, for example env: followed by MY_VARIABLE: my-value. The equals-sign forms are not valid YAML mappings. The environment key selects a deployment environment, not variables, and var is not a workflow key at all.

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.