nerdexam
Microsoft

GH-200 · Question #45

As a developer, you are designing a workflow and need to communicate with the runner machine to set environment variables, output values used by other actions, add debug messages to the output logs…

The correct answer is E. workflow commands. Workflow commands are the mechanism GitHub Actions provides for steps to communicate with the runner. They are written to stdout using the ::command:: syntax (e.g., ::set-env::, ::set-output::, ::debug::, ::add-mask::). This is the only option that directly addresses all listed…

Author and Maintain Workflows

Question

As a developer, you are designing a workflow and need to communicate with the runner machine to set environment variables, output values used by other actions, add debug messages to the output logs, and other tasks. Which of the following options should you use?

Options

  • Acomposite run step
  • Benable debug logging
  • Cself-hosted runners
  • Denvironment variables
  • Eworkflow commands

How the community answered

(26 responses)
  • B
    8% (2)
  • C
    4% (1)
  • E
    88% (23)

Explanation

Workflow commands are the mechanism GitHub Actions provides for steps to communicate with the runner. They are written to stdout using the ::command:: syntax (e.g., ::set-env::, ::set-output::, ::debug::, ::add-mask::). This is the only option that directly addresses all listed needs: setting environment variables, outputting values, and adding debug messages. The other options (composite steps, debug logging, self-hosted runners, environment variables as a concept) do not provide this communication channel.

Topics

#Workflow commands#Runner communication#GitHub Actions#Environment variables

Community Discussion

No community discussion yet for this question.

Full GH-200 Practice