Introduction
Artifacts in GitHub Actions are simple only when the upload and download steps agree on the same name, action generation, and workflow context. If the producer and consumer drift even slightly, the download step fails with a not-found style error even though the build looks like it uploaded something successfully. The fix is to verify the exact artifact identity and scope rather than guessing from the job names.
Symptoms
download-artifactsays it cannot find any artifacts for the workflow run- An artifact appears to upload successfully, but a later job still fails to fetch it
- The workflow was recently migrated between
upload-artifactordownload-artifactmajor versions - Matrix or dynamically generated artifact names differ subtly between upload and download steps
Common Causes
- The upload and download steps use different artifact names
- Artifact action major versions are mixed in ways the workflow did not account for
- The consumer job expects an artifact from another run without passing the right scope
- Dynamic naming uses different expressions in the producer and consumer jobs
Step-by-Step Fix
- 1.Make the artifact name explicit and identical
- 2.Use one exact string or one shared expression on both sides. Do not duplicate similar but hand-typed names.
```yaml - uses: actions/upload-artifact@v4 with: name: build-output path: dist/
- uses: actions/download-artifact@v4
- with:
- name: build-output
- path: dist/
`
- 1.Keep upload and download action versions aligned
- 2.If you upgrade one side of the artifact flow, upgrade the other side intentionally and test the whole round trip.
- 3.Verify whether the artifact belongs to the current workflow run
- 4.Same-run downloads are straightforward. Cross-run retrieval needs explicit context and should not be assumed.
- 5.**Use
patternonly when artifact naming is intentionally broad** - 6.Pattern downloads can help with matrix builds, but they should not be a substitute for understanding what each job actually produced.
Prevention
- Treat artifact naming like an interface contract between jobs
- Keep upload and download actions on matching major versions
- Avoid duplicating artifact names in many places without a shared variable or expression
- Test artifact round trips after workflow refactors, especially around matrix builds