GitHub Actions "Conflict: an artifact with this name already exists" (v4)
In upload-artifact v4 each artifact name within a run is immutable and unique, so a second upload to the same name in the same run is a hard conflict rather than an overwrite.
What this error means
A second upload-artifact step fails with "Conflict: an artifact with this name already exists on the workflow run", common when matrix legs share one name.
Error: Failed to CreateArtifact: Received non-retryable error: Conflict: an artifact with this name already exists on the workflow runCommon causes
Matrix legs uploading the same name
Multiple matrix jobs upload to one shared artifact name, and the second collides with the immutable first.
Re-upload to overwrite (v3 habit)
A workflow expects v3-style overwrite behavior, which v4 does not allow without the overwrite flag.
How to fix it
Make names unique or set overwrite
- Add a per-leg suffix to the artifact name (matrix.os, matrix.node).
- Set overwrite: true only when intentional replacement is desired.
- Merge multiple artifacts later with download-artifact merge-multiple.
- uses: actions/upload-artifact@v4
with:
name: results-${{ matrix.os }}-${{ matrix.node }}
path: results/How to prevent it
- Give each v4 upload a unique name per run.
- Suffix artifact names with matrix dimensions.
- Reserve overwrite: true for deliberate replacement.