nerdexam
GitHub

GITHUB-ACTIONS · Question #37

Which run: command will set a step's output?

The correct answer is A. run: echo "MY_OUTPUT=foo" >> $GITHUB_OUTPUT. The $GITHUB_OUTPUT file is used to pass data from one step to another in GitHub Actions. The echo command appends the key-value pair to this file, which sets the output variable (MY_OUTPUT) for the current step.

Use workflow components to automate software development lifecycle

Question

Which run: command will set a step's output?

Options

  • Arun: echo "MY_OUTPUT=foo" >> $GITHUB_OUTPUT
  • Brun: export MY_OUTPUT=foo
  • Crun: echo ${{ $GITHUB_OUTPUT=foo }}
  • Drun: echo "::set-env name=MY OUTPUT::foo"

How the community answered

(31 responses)
  • A
    90% (28)
  • C
    6% (2)
  • D
    3% (1)

Explanation

The $GITHUB_OUTPUT file is used to pass data from one step to another in GitHub Actions. The echo command appends the key-value pair to this file, which sets the output variable (MY_OUTPUT) for the current step.

Topics

#step outputs#GITHUB_OUTPUT#output variables#workflow commands

Community Discussion

No community discussion yet for this question.

Full GITHUB-ACTIONS Practice