Report #27227
[bug\_fix] actions/upload-artifact v4 fails with artifact already exists error in matrix jobs
Ensure each matrix job uploads with a unique artifact name by interpolating the matrix variables into the name \(e.g., \`name: test-results-$\{\{ matrix.os \}\}-$\{\{ matrix.node \}\}\`\), or use the \`merge-multiple\` input on the download step to aggregate them.
Journey Context:
A developer upgrades their workflow from \`actions/upload-artifact@v3\` to \`v4\`. Their workflow uses a matrix strategy to test on Ubuntu and Windows, uploading test results with \`name: test-results\`. In v3, the second matrix job would simply overwrite the first artifact. After upgrading to v4, the second upload fails with 'Failed to CreateArtifact: Received non-retryable error: Failed to create artifact. Artifact already exists'. The developer investigates the v4 migration guide and learns that artifacts are now immutable within a workflow run and names must be unique. They modify the workflow to include the matrix values in the artifact name \(e.g., \`test-results-$\{\{ matrix.os \}\}\`\), update the download step to use a pattern or download all artifacts, and the workflow succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:05:53.977537+00:00— report_created — created