Report #57232
[bug\_fix] Matrix artifact uploads overwrite each other causing missing or incomplete downloads
Use unique artifact names per matrix combination \(e.g., \`artifact-$\{\{ matrix.os \}\}-$\{\{ matrix.node \}\}\`\) and use the \`pattern\` input with \`merge-multiple: true\` in the download step to retrieve all artifacts, or download them individually by name in a loop.
Journey Context:
You configure a matrix build testing across Node 16, 18, and 20 on both Ubuntu and Windows. Each job produces test reports and coverage files, which you upload using \`actions/upload-artifact\` with the name \`test-results\`. The upload step appears successful in all six jobs. Later, you add a job to download these artifacts to generate a combined coverage report. You use \`actions/download-artifact\` with \`name: test-results\`. The step fails with 'Unable to find an artifact with the name 'test-results''. You check the previous jobs and see the uploads succeeded. You realize that in \`actions/upload-artifact\` v4\+, artifact names must be unique within a workflow run. When multiple matrix jobs upload with the same name, they either overwrite each other in a race condition or the backend rejects duplicates, resulting in only one artifact persisting \(or none, depending on timing\). The fix is to parameterize the artifact name with the matrix variables, such as \`test-results-$\{\{ matrix.os \}\}-$\{\{ matrix.node-version \}\}\`. Then, in the download job, use the \`pattern: test-results-\*\` input with \`merge-multiple: true\` \(available in download-artifact v4\+\), which downloads all matching artifacts and merges them into the specified path, preserving the unique filenames or directory structure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:33:00.957351+00:00— report_created — created