GitHub Actions Artifact Merge Fails - actions/upload-artifact/merge
Merging several v4 artifacts into one with actions/upload-artifact/merge fails when the input pattern matches no artifacts, the merged name collides with an existing one, or the source artifacts were never uploaded.
What this error means
The merge step errors that it found no artifacts to merge, or that the target name already exists, leaving you without the combined artifact you expected from a matrix.
Actions log
Error: No artifacts found matching pattern 'coverage-*'
# or
Error: an artifact with name 'coverage' already existsCommon causes
Pattern matches no uploaded artifacts
merge gathers artifacts by name pattern. If the matrix jobs uploaded under different names, or failed to upload, the pattern matches nothing.
Merged name collides
In v4 each artifact name must be unique within a run. If the merge target name already exists, the merge is rejected.
How to fix it
Upload uniquely, then merge by pattern
.github/workflows/ci.yml
# in the matrix job
- uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.shard }}
path: coverage/
# in a later job
- uses: actions/upload-artifact/merge@v4
with:
name: coverage
pattern: coverage-*
delete-merged: trueEnsure sources exist and names are unique
- Give each matrix artifact a unique name that the merge pattern matches.
- Confirm the upload steps ran and succeeded before the merge job.
- Pick a merged name not already used in the run, or set delete-merged.
How to prevent it
- Name per-matrix artifacts uniquely and matchably (coverage-<shard>).
- Run the merge in a job that needs the matrix jobs.
- Use a fresh merged name or delete-merged to avoid collisions.
Related guides
GitHub Actions "Cache already exists" - Entries Are ImmutableUnderstand GitHub Actions cache immutability - once a key is saved you cannot overwrite it, so updated conten…
GitHub Actions "an artifact with this name already exists" - overwriteFix GitHub Actions v4 upload "an artifact with this name already exists" - names are unique per run, so re-up…
GitHub Actions Job Outputs Truncated or Dropped at Size LimitFix GitHub Actions job outputs that come through truncated or empty - job and step outputs have a size cap, s…