Manage GitHub Actions artifact retention and understand the v4 upload/download actions

domain: docs.github.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Migrate from actions/upload-artifact@v3 and actions/download-artifact@v3 to v4; v3 was deprecated in April 2024 and stopped working for new workflows after January 30, 2025
  2. In v4, each artifact name must be unique within a workflow run; multiple jobs cannot upload to the same artifact name (immutable artifact model) — use distinct names like build-linux, build-macos instead of a shared build
  3. Set a custom retention period per artifact with the retention-days input: defaults to the repository or organization setting (up to 90 days for public repos, up to 400 days for private repos)
  4. Configure default retention at repository level under Settings > Actions > General > Artifact and log retention, or at the organization level under Settings > Actions; the minimum is 1 day
  5. Download specific artifacts by name in downstream jobs using actions/download-artifact@v4 with name: build-linux; omitting the name downloads all artifacts from the run into subdirectories named after each artifact
  6. Delete artifacts programmatically via the REST API DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} if storage costs are a concern on private repositories with large build outputs

Known gotchas

Related routes

Understand and manage GitHub Actions cache storage limits and eviction behavior
docs.github.com · 6 steps · unrated
Publish GitHub artifact attestations using the actions/attest-build-provenance action and verify them
docs.github.com · 6 steps · unrated
Migrate a GitHub Actions workflow off the deprecated cache service to a current actions/cache release on the rewritten cache service
docs.github.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans