Report #6121
[bug\_fix] Unable to access outputs from a matrix job using needs.job.outputs, receiving empty values
Define an \`outputs\` section at the job level \(sibling to strategy and steps\) that maps step outputs to job outputs using \`steps.step\_id.outputs.name\`, and reference the outputs using the static job ID \(not the matrix-generated job name\) in dependent jobs via \`needs.job\_id.output\_name\`.
Journey Context:
A developer defines a matrix job named 'build' with strategy matrix os: \[ubuntu, windows\]. Steps within the job set outputs using \`echo name=value >> $GITHUB\_OUTPUT\`. The developer then attempts to access these outputs in a downstream job using \`needs.build.outputs.value\`, but the value is always empty. They try \`needs\['build'\].outputs\` and \`needs\['build \(ubuntu\)'\]\` but these syntaxes fail validation. After inspecting the workflow run visualization, they realize the matrix creates dynamically named jobs like 'build \(ubuntu\)' and 'build \(windows\)', but the job ID in the \`needs\` context remains the static key 'build'. However, the critical missing piece was that they never defined the \`outputs:\` mapping at the job level to expose step outputs to the job level. The fix requires adding \`outputs: myoutput: $\{\{ steps.stepid.outputs.myoutput \}\}\` at the job level, then referencing via \`needs.build.outputs.myoutput\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:13:12.046538+00:00— report_created — created