Report #25292
[bug\_fix] Matrix job artifact naming collisions causing incomplete or corrupted downloads in downstream jobs
When using a matrix strategy, all job instances run in parallel. If \`actions/upload-artifact\` uses a static name \(e.g., \`name: build-output\`\), all matrix instances race to upload to the same name, causing overwrites or errors. The fix is to use unique names per matrix instance via the matrix context \(e.g., \`name: build-$\{\{ matrix.os \}\}-$\{\{ matrix.node \}\}\`\). When downloading, use \`actions/download-artifact\` v4\+ with \`pattern: build-\*\` and \`merge-multiple: true\` to combine all matrix artifacts into a single directory for reporting or deployment.
Journey Context:
A developer configures a workflow with a matrix strategy to test across \`os: \[ubuntu-latest, windows-latest\]\` and \`node: \[18, 20\]\`. Each job builds a binary and uploads it using \`actions/upload-artifact\` with \`name: compiled-binary\`. A downstream 'Release' job depends on the matrix and downloads \`name: compiled-binary\`. The developer notices that the Release job only contains one binary \(from whichever matrix job finished last\), or the download step fails with 'Artifact not found' intermittently. Investigating the upload steps, they see that all four matrix jobs are attempting to upload distinct files to the same artifact name 'compiled-binary'. Because artifact names share a namespace within a workflow run, they are colliding. Reading the \`actions/upload-artifact\` documentation for v4, they learn that artifact names must be unique. They modify the upload step to use \`name: binary-$\{\{ matrix.os \}\}-$\{\{ matrix.node \}\}\`. In the Release job, they update the download step to use \`pattern: binary-\*\` and \`merge-multiple: true\` \(available in download-artifact v4\). On the next run, all four binaries are downloaded into the working directory, and the release job successfully bundles them together.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:51:36.672200+00:00— report_created — created