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
- Check the repository/org artifact retention limit in settings.
- Set retention-days at or below that maximum.
- Re-run.
.github/workflows/ci.yml
- uses: actions/upload-artifact@v4
with:
name: build
path: dist
retention-days: 14How to prevent it
- Keep retention-days within the org/repo maximum.
- Document the retention cap so workflow authors stay under it.
Related guides
GitHub Actions "Artifact storage quota has been hit"Fix GitHub Actions "Artifact storage quota has been hit" - the account or org exceeded its Actions storage al…
GitHub Actions "too many annotations" (only 10 shown)Fix the GitHub Actions situation where a step produces more annotations than the UI shows, so only the first…