Repository navigation
ci: manual cleanup workflow for claude-code GHCR images - #84
Merged
Merged
Conversation
Adds a workflow_dispatch-only workflow that prunes old versions of the ghcr.io/gatezh/devcontainers/claude-code and claude-code-sandbox packages. Other packages in this repo are out of scope and unreachable from this workflow. Defaults are conservative: 90-day retention and dry-run=true, so the first "Run workflow" click is always a safe preview. To actually delete, re-run with the dry-run checkbox unchecked. `latest` is preserved unconditionally via exclude-tags. One-time setup: each target package must grant this repository the "Admin" role under Package Settings -> Manage Actions access in the GHCR UI; otherwise the action returns 403.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a manually-triggered GitHub Actions workflow that prunes old container versions of the
claude-codeandclaude-code-sandboxpackages on GHCR.Why
build-claude-code.ymlruns daily and pushes three new tags per image (latest,<sha>,<YYYYMMDD>) for two architectures. Each timelatestmoves, the previous manifest becomes untagged but stays forever — GHCR never auto-prunes. Over months this clutters the package version list and slows API paging. Public packages have free unlimited storage on GHCR, so this is a hygiene improvement, not a cost fix.Other images in this repo (
bun,hugo-bun,hugo-bun-node,ralphex-fe,claude-bun) only rebuild on Dockerfile changes and don't have the same accumulation problem, so they're explicitly out of scope.Changes
.github/workflows/cleanup-claude-code-ghcr.ymlworkflow_dispatchonly — no cron, no automatic executionretention-days(default90),dry-run(defaulttrue)[claude-code, claude-code-sandbox]so each package is processed independentlydataaxiom/ghcr-cleanup-action@v1, which is multi-arch-safe (it skips child manifests still referenced by tagged manifest lists)exclude-tags: latestunconditionally preserves the movinglatestpointerNotes
One-time setup required before the first real run: for each of the two packages, open Package settings → Manage Actions access in the GHCR UI, add this repository, and grant Admin. Without that, the action returns 403.
Verification (post-merge, since
workflow_dispatchonly resolves once onmaster):latestis preserved and only versions older than 90 days are listed.docker manifest inspect ghcr.io/gatezh/devcontainers/claude-code:lateststill returns bothlinux/amd64andlinux/arm64entries.CI will only run
actionlinton this PR (no Dockerfile changes);actionlintwas also run locally and passes.