GitHub capability
Download GitHub Actions artifacts
Use the REST API to download an artifact by ID as a ZIP. Use gh run download to select and extract artifacts from a workflow run.
Documentation reviewed
Ways to do it
API
GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/zip
Request a ZIP download for one artifact and follow the redirect.
- Requirements
- Artifact ID and repository access. A fine-grained token for a private repository needs Actions read permission.
- Limitations
- Expired artifacts return HTTP 410. The redirect for an available artifact lasts one minute.
CLI
gh run download <run-id> --name <artifact-name>
Select an artifact from a run by name or use --pattern to select several. The CLI extracts the downloaded files.
- Requirements
- GitHub CLI authenticated for the repository, the run ID, and an artifact name or pattern.
- Limitations
- The command extracts the archive. Use the REST download if you need the ZIP itself.
Example
gh run download "$RUN_ID" --repo "$OWNER/$REPO" --name "$ARTIFACT_NAME" --dir ./artifactsInterface
Actions → workflow run → Artifacts
Open a run and download an artifact by name from its summary.
- Requirements
- Sign in to GitHub with read access to the repository.
- Limitations
- You can only download artifacts while they’re available under the repository’s retention policy.