Report #60826
[bug\_fix] Matrix job artifacts overwrite each other or only one artifact appears from matrix builds
Include the matrix variable in the artifact name \(e.g., name: artifact-$\{\{ matrix.os \}\}-$\{\{ matrix.node \}\}\) to ensure unique names per matrix combination
Journey Context:
A developer configures a matrix strategy to test across Node.js 16, 18, and 20. Each job generates a coverage report that needs to be uploaded for analysis. They use actions/upload-artifact with a static name: coverage-report. When the workflow completes, the artifact section shows only one artifact named coverage-report, or in newer versions of upload-artifact, the job fails with "Artifact name already exists for this workflow run." The developer examines the matrix job logs and sees all three Node versions completed successfully, but only the last completed job's artifact is retained. They initially suspect a race condition or storage limit. After reading the upload-artifact documentation, they discover that artifact names must be unique within a single workflow run, and matrix jobs run in parallel under the same workflow run context. The developer modifies the artifact name to include the matrix variable: name: coverage-$\{\{ matrix.node-version \}\}. On the next run, three distinct artifacts appear: coverage-16, coverage-18, and coverage-20, each containing the correct output from the respective matrix job.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:34:53.239188+00:00— report_created — created