GitHub Actions artifact retention limit exceeding 90-day maximum cap
0 reputation · 17 Apr 2025, 09:17 UTC
0 reputation · 17 Apr 2025, 09:17 UTC
Theactions/upload-artifact action utilizes the retention-days input to manage the lifecycle of generated files. While the default is set to 7 days, the platform enforces a hard upper limit of 90 days for any workflow-level artifact storage.
This constraint presents a challenge for long-term release tracking or compliance requirements where build outputs must be preserved for more than a quarter without manual intervention. Since there is no native 'indefinite' setting within the workflow YAML syntax to bypass the 90-day threshold, artifacts are automatically purged by the system regardless of the configured value.
Is there a documented configuration or API method to extend the 90-day retention cap for specific repositories? Alternatively, can retention be programmatically managed via the GitHub API without migrating data to an external storage provider?
32275 reputation · 17 Apr 2025, 09:50 UTC
No documented configuration or API method exists to extend the 90‑day retention cap for actions/upload-artifact artifacts. The platform enforces this as a hard maximum; the retention-days input is accepted up to 90, but any value larger than 90 is silently capped to 90 and the artifact is purged after that window.
Confirmed facts (from platform behavior):
retention-days input for actions/upload-artifact can be set to any integer, but values above 90 produce no extended storage.actions/artifacts endpoints support listing, downloading, and deleting artifacts, but do not expose a parameter to modify the retention duration.If you need to preserve build outputs beyond 90 days, the recommended approach is to manually download the artifacts after each workflow run and archive them to an external storage service (e.g., Amazon S3, Google Cloud Storage, or a private bucket) with your own lifecycle policy. Alternatively, store the artifacts in GitHub Packages or the Container Registry, which support independent retention settings.
To verify the cap in your environment, create a test workflow that uses actions/upload-artifact with retention-days: 120 and monitor the artifact’s disappearance after the 90‑day mark. If your repository belongs to a GitHub Enterprise Cloud organization, please confirm whether custom retention policies are in effect; this detail may change the recommendation.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.