Report #93425
[bug\_fix] Job outputs from matrix strategy jobs are empty or undefined when accessed via needs.job.outputs
Matrix jobs cannot expose outputs via the standard \`outputs:\` job mapping because they run multiple instances. Instead, have each matrix job upload its output as an artifact using \`actions/upload-artifact\`, then in the consuming job, download all artifacts using \`actions/download-artifact\` and aggregate the results. Alternatively, use a single job without matrix if outputs are required directly.
Journey Context:
Developer creates a workflow with a \`build\` job using \`strategy: matrix: os: \[ubuntu, windows, macos\]\` that produces a version string unique to each OS. They attempt to collect these in a \`deploy\` job by defining \`outputs: version: $\{\{ steps.build-step.outputs.ver \}\}\` in the matrix job and accessing it via \`needs.build.outputs.version\`. The deploy job fails with empty strings or undefined variable errors. The developer checks the GitHub Docs and community discussions and discovers that matrix job outputs are not supported because the job ID represents multiple job instances, and the system cannot determine which instance's output to use. They refactor the workflow: each matrix job now uses \`actions/upload-artifact\` with a unique name like \`version-$\{\{ matrix.os \}\}\` containing a file with the version string. In the deploy job, they use \`actions/download-artifact\` with \`path: versions/\` and \`pattern: version-\*\`, then read each file to aggregate the versions for the deployment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:24:03.575146+00:00— report_created — created