GitHub Actions Download an Artifact From a Different Workflow Run
An artifact uploaded by one workflow run is not found by a different run because actions/download-artifact defaults to the current run. To fetch across runs you must pass run-id and a github-token with access.
What this error means
A download-artifact step in a separate run (often a workflow_run-triggered one) fails to find the artifact, because it looked in the current run’s artifacts instead of the producing run’s.
- uses: actions/download-artifact@v4
with:
name: build-output
# Error: Unable to find any artifacts for the associated workflow runCommon causes
Default scope is the current run
download-artifact looks at the current run’s artifacts unless told otherwise. An artifact from another run is not visible without run-id.
Missing run-id or token
Cross-run download needs the producing run’s id and a github-token with actions:read so the action can fetch it.
How to fix it
Pass run-id and a token
Provide the source run id (e.g. from the workflow_run event) and a token with read access.
- uses: actions/download-artifact@v4
with:
name: build-output
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
permissions:
actions: readConfirm the artifact and access
- Check the artifact still exists and has not passed its retention window.
- Grant actions: read so the token can list and download cross-run artifacts.
- For cross-repo downloads, use a token with access to the source repository.
How to prevent it
- Pass run-id and github-token when downloading across runs.
- Grant actions: read for cross-run artifact access.
- Mind artifact retention so the source artifact still exists.