Github Actions Fix Download Artifact Url May 2026
Use the GET /actions/artifacts/artifact_id/zip API endpoint. Automation: Use gh CLI for simplified scripting. If you'd like to automate this process further:
Artifacts are not permanent. The default retention period is 90 days (though this can be customized in repo settings).
This guide covers everything from basic downloading to automating URL generation for external scripts. 1. The Basics: GitHub Actions Download Artifact github actions download artifact url
Once you have the artifact_id , use the following endpoint to get a redirect URL: GET /repos/owner/repo/actions/artifacts/artifact_id/zip
- name: Upload Artifact uses: actions/upload-artifact@v4 with: name: build-output path: dist/ - name: Get Artifact URL run: | ARTIFACT_ID=$(curl -H "Authorization: token $ secrets.GITHUB_TOKEN " \ "https://github.com github.repository /actions/runs/$ github.run_id /artifacts" \ | jq '.artifacts[0].id') echo "Download URL: https://github.com github.repository /actions/runs/$ github.run_id /artifacts/$ARTIFACT_ID" Use code with caution. 5. Security and Retention Considerations Use the GET /actions/artifacts/artifact_id/zip API endpoint
However, if you need the to download these programmatically (e.g., via curl or a Slack notification), you must use the GitHub API. 2. Generating a Download URL via GitHub API
Even with a direct URL, users must have read access to the repository to download the file. 6. Summary Checklist Internal transfers: Use actions/download-artifact@v4 . Manual downloads: Use the Actions tab in the GitHub UI. The default retention period is 90 days (though
First, you need the unique ID of the artifact. You can list artifacts for a specific run using this endpoint: GET /repos/owner/repo/actions/runs/run_id/artifacts Step 2: Get the Download Link
