Report #8344
[bug\_fix] Matrix job outputs inaccessible or overwritten in dependent job
Do not attempt to access individual matrix instance outputs via the \`needs\` context. Instead, have matrix jobs upload artifacts \(using \`actions/upload-artifact\`\), then have the dependent job download all artifacts \(using \`actions/download-artifact\`\) and aggregate them. Alternatively, use \`include\` in the matrix to define separate job IDs if you must use outputs.
Journey Context:
A testing workflow uses a matrix strategy to run tests across Node versions \`\[16, 18, 20\]\`, with each job producing a coverage percentage output. A final \`aggregate\` job lists \`needs: test\` and attempts to collect these outputs using \`needs.test.outputs.coverage\`. The workflow fails with either empty values or only the output from whichever matrix instance finished last \(Node 20\). The developer tries various syntaxes like \`needs.test\['node-16'\].outputs\` or \`needs.test.outputs\['node-16'\]\`, all of which fail validation. Searching GitHub Community discussions reveals that the \`needs\` context only contains outputs from the last completed instance of a matrix job, and individual matrix instance outputs are not addressable. The accepted solution is to have matrix jobs upload coverage reports as artifacts with unique names \(including matrix values\), then have the aggregate job download all artifacts and parse them.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T05:16:27.326790+00:00— report_created — created