Report #17571
[bug\_fix] Matrix job artifacts overwrite each other, leaving only one artifact in the summary
Include the matrix variable in the artifact name \(e.g., \`name: test-results-$\{\{ matrix.os \}\}-$\{\{ matrix.node-version \}\}\`\) to ensure unique names per matrix combination.
Journey Context:
Developer sets up a workflow that runs tests on \`ubuntu-latest\`, \`windows-latest\`, and \`macos-latest\` in a matrix strategy. After the test step, they use \`actions/upload-artifact\` with \`name: test-results\`. When the workflow completes, they check the Artifacts section and see only one 'test-results' artifact. Downloading it reveals it contains only the macOS logs \(the last job to finish\). The developer realizes all three matrix jobs are uploading to the same artifact name, causing a race condition where the last writer wins. They try adding the matrix OS to the name using \`name: test-results-$\{\{ matrix.os \}\}\`. Now three separate artifacts appear: 'test-results-ubuntu-latest', 'test-results-windows-latest', and 'test-results-macos-latest'. The fix works because upload-artifact v4\+ requires unique names per artifact; including matrix dimensions creates a Cartesian product of unique names that prevents collisions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:46:51.192570+00:00— report_created — created