GitHub Actions "Unable to download artifact" - download-artifact v4
download-artifact could not find the artifact - the name does not match, the producing job has not finished or is in a different run, or you need needs: to order the jobs.
What this error means
A download step fails with "Unable to find an artifact with the name" or downloads nothing, because the artifact does not exist yet in the scope the action looked.
Error: Unable to find an artifact with the name: site
# the producing job had not finished, or the name/run scope is wrongCommon causes
Name mismatch or producer not done
The download name must exactly match the upload, and the producing job must complete first - which requires a needs: dependency.
Cross-run download without run-id
By default v4 downloads artifacts from the current run. To pull from another workflow run you must pass run-id and a token.
How to fix it
Order jobs and match the name
download:
needs: build # wait for the producer
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: site # exact name from uploadDownload from another run explicitly
Set run-id (and a token with actions: read) to fetch an artifact produced by a different workflow run.
- uses: actions/download-artifact@v4
with:
name: site
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}How to prevent it
- Add needs: so a download never races the producing job.
- Keep upload and download names identical.
- Pass run-id and a token for cross-run artifact downloads.