exam questions

Exam GH-200 All Questions

View all questions & answers for the GH-200 exam

Exam GH-200 topic 1 question 27 discussion

Actual exam question from Microsoft's GH-200
Question #: 27
Topic #: 1
[All GH-200 Questions]

Which of the following commands will set the $FOO environment variable within a script, so that it may be used in subsequent workflow job steps?

  • A. run: echo "::set-env name=FOO::bar"
  • B. run: echo "FOO=bar" >> $GITHUB_ENV
  • C. run: echo ${{ $FOO=bar }}
  • D. run: export FOO=bar
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
MaharshiRabari
9 hours, 42 minutes ago
Selected Answer: B
Why others are wrong? A. set-env is deprecated and disabled for security. GitHub removed it due to a security vulnerability. C. Invalid syntax ${{ $FOO=bar }} is not valid GitHub expression syntax. D. export FOO=bar only lasts inside the same step Environment variables set with export disappear after the step ends.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...