Skip to content
Latchkey

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 exists

Common 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: true

Ensure sources exist and names are unique

  1. Give each matrix artifact a unique name that the merge pattern matches.
  2. Confirm the upload steps ran and succeeded before the merge job.
  3. 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →