Skip to content

ci: add scheduled GHCR cleanup of stale devcontainer versions - #1239

Merged
c-vigo merged 1 commit into
devfrom
feature/1238-ghcr-cleanup
Jul 21, 2026
Merged

c-vigo merged 1 commit into
devfrom
feature/1238-ghcr-cleanup

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Closes #1238

What

Adds a devkit-only scheduled workflow .github/workflows/ghcr-cleanup.yml (weekly Mon 04:00 UTC + workflow_dispatch with dry-run defaulting to true for safe manual previews) that prunes stale versions of the vig-os/devcontainer org package using dataaxiom/ghcr-cleanup-action v1.2.2 (SHA-pinned; Renovate's github-actions manager will keep it fresh):

  • delete-untagged: true — orphaned nix-dev* discovery generations (~3 per dev/epic push).
  • delete-orphaned-images: true — dangling attestation referrers + orphaned sha256-* referrer tags left behind by the promote-release RC prune.
  • older-than: 7 days age guard, validate: true manifest integrity check.
  • Default GITHUB_TOKEN with job-scoped packages: write — same mechanism as the existing promote-release GHCR prune step.

Not scaffolded to consumers (root workflows only; not in assets/workspace/ or the sync manifest), so outside the zizmor-managed audit scope; covered by actionlint/yamllint/shellcheck pre-commit hooks. No CHANGELOG entry per repo rules (ci-internal).

Validation evidence (pre-merge, acceptance criteria of #1238)

Ran the pinned action locally (node dist/index.js at d52806a0, Node 24) against the live package, three configurations, all dry-run=true (587 versions loaded each run):

Run Options Would delete Kept
1 delete-untagged + older-than: 7 days 298 289
2 delete-untagged only 382 205
3 run 2 + delete-orphaned-images 423 164
  • Keep-safety PASS: zero live tagged versions in any delete set. Explicitly verified kept: 1.4.0/latest, 1.3.1, 1.3.0, current nix-dev* trio, all sha256-* cosign/referrer tags of live releases, and the untagged attestation children of 1.4.0/1.3.1/1.3.0 (cross-checked against live referrer indexes fetched from GHCR).
  • Delete-effectiveness PASS: old orphaned nix-dev generations (index + arch children) and dangling attestation manifests (subject digest gone) land in the delete set; the dangling ones specifically require delete-orphaned-images (run 3), hence that option.
  • validate mode: 107 warnings (existing dangling-referrer debt this workflow removes), 0 errors, no ghost/partial images.

Notes

  • First scheduled run executes from the default branch after merge/promotion; a manual workflow_dispatch (dry-run preview) can be exercised any time after merge as a final live check.
  • TDD skipped: config-only workflow, no testable script surface (selection logic lives in the pinned action).

Weekly referrer-aware sweep of the vig-os/devcontainer org package:
delete-untagged reaps orphaned nix-dev discovery generations,
delete-orphaned-images reaps dangling attestation referrers left by the
promote-release RC prune. Config-only change (no TDD surface); validated
by three local dry-runs of the pinned action against the live package —
no release, floating, or cosign tag and no live attestation referrer in
any delete set.

Refs: #1238
@c-vigo
c-vigo merged commit bfb458f into dev Jul 21, 2026
13 checks passed
@c-vigo
c-vigo deleted the feature/1238-ghcr-cleanup branch July 21, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant