From 88cf4a98abaf05da39dbb73c1190683e1a4ce95f Mon Sep 17 00:00:00 2001 From: Amin Dhouib Date: Wed, 2 Sep 2026 11:03:59 -0400 Subject: [PATCH] Add a 90-day retention bucket; unset retention-days now expires after 14 days The bucket's untagged lifecycle rule was lowered from 90 to 14 days to match how the org actually uses artifacts (test reports, Playwright/Lighthouse output, screenshots). Workflows that ask for more than 30 days get a retention=90 tag instead of silently falling back to the default. --- README.md | 5 +++-- lib/main.py | 4 ++-- upload/action.yml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 07598b7..d938b52 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,9 @@ to GitHub's blob store. This action writes to devino instead. artifacts of the run, and extracts safely into `path`. Retention is enforced by bucket lifecycle rules: `retention-days` is rounded -up to 1/3/5/7/14/30 days and stored as an object tag; anything else expires -after 90 days. +up to 1/3/5/7/14/30/90 days and stored as an object tag (values above 90 are +capped at 90). When `retention-days` is not set the artifact expires after +14 days, which matches how the org's test reports and screenshots are used. ## Inputs diff --git a/lib/main.py b/lib/main.py index 23732c6..ed4888a 100644 --- a/lib/main.py +++ b/lib/main.py @@ -37,7 +37,7 @@ DEFAULT_AUDIENCE = "storage.devino.ca" # Lifecycle rules on the bucket expire objects tagged retention= after N # days; untagged objects expire after 90 days (same default as GitHub). -RETENTION_BUCKETS = [1, 3, 5, 7, 14, 30] +RETENTION_BUCKETS = [1, 3, 5, 7, 14, 30, 90] GLOB_CHARS = set("*?[") @@ -355,7 +355,7 @@ def retention_tag(days): for b in RETENTION_BUCKETS: if n <= b: return b - return None # > 30 days: bucket default (90) + return RETENTION_BUCKETS[-1] # > 90 days: cap at the longest rule def do_upload(): diff --git a/upload/action.yml b/upload/action.yml index a3972a7..40596b4 100644 --- a/upload/action.yml +++ b/upload/action.yml @@ -16,7 +16,7 @@ inputs: description: "warn | error | ignore" default: warn retention-days: - description: "Days to keep the artifact (1-90). Rounded up to 1/3/5/7/14/30; anything above 30 keeps the 90-day default." + description: "Days to keep the artifact. Rounded up to 1/3/5/7/14/30/90 (capped at 90); unset means 14 days." default: "" compression-level: description: "gzip level 0-9"