ci: purge orphaned GHCR attestation referrers - #5622
Open
swiffer wants to merge 3 commits into
Open
Conversation
Enable delete-orphaned-images on the existing untagged cleanup so leftover sha256-* attestation tags are removed after their parent image is gone.
✅ Deploy Preview for teslamate ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
|
Nice!
I changed that, we can use manual dispatch to test it (everybody with write access). see "ci: let maintainers run CI on pull requests touching .github (#5593 - @JakobLichterfeld)" |
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.
Motivation
The
teslamateGHCR package has far more tagged versions thanteslamate/grafana(currently ~223 vs ~16). Most of the extra teslamate tags are not product versions.Since #5380, published images get signed SLSA provenance and SPDX SBOMs with
push-to-registry: true. That writes OCI referrers onto the same package assha256-*tags. Teslamate is built per-platform and then merged, so eachmainpush can add several of those tags (provenance + SBOM per arch, plus manifest-list provenance). Grafana is one multi-arch image and only attests the list, so it stays small.:mainis a moving tag. After it moves, the old image becomes untagged and is already eligible for the existing 1-day untagged cleanup. The leftoversha256-*referrers stay tagged, so they never get purged. They describe images nobody is told to pull anymore.The GitHub attestation store (
gh attestation verify --repo teslamate-org/teslamate) is separate. This PR only cleans GHCR package versions. It does not delete repo attestations.#5380 intentionally attests merged-to-main (PRs are skipped so unreviewed code cannot look official). This change does not undo that. Current
:main/:pr-*referrers stay because their parent image still exists.What this does
Enable
delete-orphaned-images: trueon the existing untagged-cleanup step inghcr_purge.yml. Same action, same packages, sameolder-than: 1 daywindow.dataaxiom/ghcr-cleanup-actionalready treats attestation/cosign referrers as children:sha256-*referrers) from the working setSo one step is enough:
sha256-*referrers cascade with itdelete-orphaned-imagesonly catches referrers whose parent is already gone (leftovers from an earlier incomplete cleanup)No new workflow, no extra action call, no change to how attestations are generated.
Note
This workflow still only runs when a same-repo PR is closed, and
.github-only PRs are excluded. Closing this PR will not run the purge. The next qualifying PR close will.