Skip to content
Latchkey

GitHub Actions artifact retention exceeds the org policy limit

Organizations and repositories can cap artifact and log retention. An upload-artifact step requesting more retention-days than the policy allows is rejected or silently clamped.

What this error means

An upload-artifact step warns or errors that the requested retention exceeds the configured maximum.

github-actions
Warning: Retention days cannot be greater than the maximum allowed retention set within the repository: 30 days.

Common causes

retention-days above the org/repo cap

The workflow asked for more days than the admin-configured maximum, so the request is clamped or rejected.

How to fix it

Set retention-days within the policy

  1. Check the repository/org artifact retention limit in settings.
  2. Set retention-days at or below that maximum.
  3. Re-run.
.github/workflows/ci.yml
- uses: actions/upload-artifact@v4
  with:
    name: build
    path: dist
    retention-days: 14

How to prevent it

  • Keep retention-days within the org/repo maximum.
  • Document the retention cap so workflow authors stay under it.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →