ci(images): clean up stale development images #30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/clean-development-packages"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
<version>-dev.<commit>) were never removed, so merged and superseded branches left packages behind.main. This needs no branch-to-commit mapping, so it also covers superseded pushes and force-pushes.Changes
scripts/clean-development.sh: lists both packages, deletes stale-dev.<sha>versions, and deletes the untaggedsha256:manifest versions the forge may leave behind, but only when no remaining tag refers to them (directly or as a child of an image index) and they are older than an hour. Releases,latestanddevelopmentare never deleted. A failed manifest lookup aborts the run before anything is deleted..github/workflows/clean-development.yml: runs when a branch is deleted (merging deletes it), every Sunday as a safety net, and on demand (a manual run is a dry run by default). UsesREGISTRY_TOKENfor the packages and the job token to read the branch list.Verification
latest,development, an image index and its child manifest, and a young orphan are kept; merged-branch images, an older-version dev image and unreferenced old manifests are deleted from both packages;developmentkeeps working after its own dev tag is removed; a second run deletes nothing; a failed manifest lookup deletes nothing.1.0.0-dev.9421339; a real run then deleted 14 (the 12 plus two images of this branch's earlier probe commits, superseded by later pushes) with exit 0; a final dry run listed only the next superseded image; the remaining versions of both packages were1.0.0,latest,developmentand the branch's current head.shellcheck -xandactionlintclean.deleteevent trigger (it runs from the default branch once this is merged), and the weekly schedule.cleanup probe (DRY_RUN=1) exit 0