GitHub
GITHUB-ACTIONS · Question #30
Which syntax correctly accesses a job output (output1) of an upstream job (job1) from a dependent job within a workflow?
The correct answer is A. ${{needs.job1.outputs.output1}}. The needs context is used to reference the outputs of jobs that are dependencies of the current job. In this case, needs.job1.outputs.output1 correctly accesses the output of output1 from the job job1 in the dependent job.
Use workflow components to automate software development lifecycle
Question
Which syntax correctly accesses a job output (output1) of an upstream job (job1) from a dependent job within a workflow?
Options
- A${{needs.job1.outputs.output1}}
- B${{needs.job1.output1}}
- C${{depends.job1.output1}}
- D${{job1.outputs.output1}}
How the community answered
(30 responses)- A90% (27)
- B7% (2)
- C3% (1)
Explanation
The needs context is used to reference the outputs of jobs that are dependencies of the current job. In this case, needs.job1.outputs.output1 correctly accesses the output of output1 from the job job1 in the dependent job.
Topics
#job outputs#needs context#upstream job#workflow syntax
Community Discussion
No community discussion yet for this question.