Skip to content

ci: scheduled prune of untagged GHCR staging digests#40

Merged
KingPin merged 2 commits into
mainfrom
ci/ghcr-untagged-prune
May 19, 2026
Merged

ci: scheduled prune of untagged GHCR staging digests#40
KingPin merged 2 commits into
mainfrom
ci/ghcr-untagged-prune

Conversation

@KingPin
Copy link
Copy Markdown
Owner

@KingPin KingPin commented May 19, 2026

Summary

  • Adds .github/workflows/ghcr-prune.yml: weekly scheduled prune (Wed 05:00 UTC, day after the weekly build) of untagged versions on the ghcr.io/kingpin/php-docker package.
  • Uses dataaxiom/ghcr-cleanup-action@v1. Its cleanup algorithm removes children of live manifest lists from the working set before applying any deletion rule, so the per-arch digests referenced by current tags are not at risk even though they appear untagged.
  • older-than: 28d keeps a comfortable buffer if the weekly build is red for a week or two.
  • Ships with dry-run: true so the first scheduled run logs intended deletions without executing them. Manual workflow_dispatch exposes a dry-run boolean (defaults to true).

Closes #39

Test plan

  • Trigger via workflow_dispatch with the default dry-run: true and confirm the run summary lists only stale untagged digests (no children of live tagged manifest lists).
  • Verify a fresh docker pull ghcr.io/kingpin/php-docker:<tag> still resolves after the dry run (no-op, but sanity check).
  • Flip the workflow default dry-run to false in a follow-up commit once the dry-run output looks correct.
  • After the first real prune, re-pull a representative tag from each registry (Docker Hub, GHCR, Quay) and confirm the manifest list still resolves all platforms.

Per-arch builds in docker-ci.yml push by digest to
ghcr.io/kingpin/php-docker and accumulate as untagged versions over time.
dataaxiom/ghcr-cleanup-action removes children of live manifest lists from
its working set before pruning, so per-arch digests referenced by current
tags remain safe. Starts in dry-run mode; window is 28 days to survive a
couple of missed weekly builds.

Closes #39
Copilot AI review requested due to automatic review settings May 19, 2026 13:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new scheduled GitHub Actions workflow that prunes untagged digests from the ghcr.io/kingpin/php-docker staging package using dataaxiom/ghcr-cleanup-action@v1, addressing the accumulation of per-arch staging digests left behind by the publish pipeline. The workflow runs weekly (Wednesdays at 05:00 UTC, the day after the weekly build), supports manual workflow_dispatch, and ships in dry-run mode so the first execution only logs intended deletions.

Changes:

  • New scheduled workflow with older-than: 28d retention buffer and concurrency guard.
  • workflow_dispatch input exposes a dry-run boolean (default true) for manual verification.
  • Uses dataaxiom/ghcr-cleanup-action@v1 with delete-untagged: true and packages: write permissions only.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ghcr-prune.yml Outdated
package: php-docker
delete-untagged: true
older-than: 28d
dry-run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry-run || true }}
Previous expression had the classic A && B || C pitfall — dispatching with
dry-run unchecked still evaluated to true, so the input toggle was inert.
Invert the event check so the || branch only fires for non-dispatch events.
@KingPin KingPin merged commit 92054d1 into main May 19, 2026
23 checks passed
@KingPin KingPin deleted the ci/ghcr-untagged-prune branch May 19, 2026 14:48
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.

ci: retention policy for untagged GHCR staging digests

2 participants