-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dangling images from GHCR on schedule #941
Conversation
Signed-off-by: Fernando Fernández <[email protected]>
Signed-off-by: Fernando Fernández <[email protected]>
FYI, both actions, GHCR Pruning and Container Retention Policy, support removing dangling images from GHCR. |
I wonder if https://github.com/pi-hole/.github might be a better place for this (or similar using one of the abovementioned actions) |
@PromoFaux The problem is that GH shuts down scheduled actions in a repository after 2 months with no activity, so unless that repo receives activity (not sure what GH considers activity), it won't work properly and will need constant maintenance from your side. Here's an screenshot of the email I received in one repo where I had no activity: |
Signed-off-by: Adam Warner <[email protected]>
Signed-off-by: Adam Warner <[email protected]>
* Remove dangling images from GHCR on schedule Signed-off-by: Fernando Fernández <[email protected]> * Commit .sh file as executable, so preparation is not needed at runtime Signed-off-by: Fernando Fernández <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Adam Warner <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Fernando Fernández <[email protected]> Co-authored-by: Adam Warner <[email protected]>
* Remove dangling images from GHCR on schedule Signed-off-by: Fernando Fernández <[email protected]> * Commit .sh file as executable, so preparation is not needed at runtime Signed-off-by: Fernando Fernández <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Adam Warner <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Fernando Fernández <[email protected]> Co-authored-by: Adam Warner <[email protected]>
* Remove dangling images from GHCR on schedule Signed-off-by: Fernando Fernández <[email protected]> * Commit .sh file as executable, so preparation is not needed at runtime Signed-off-by: Fernando Fernández <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Adam Warner <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Fernando Fernández <[email protected]> Co-authored-by: Adam Warner <[email protected]>
* Remove dangling images from GHCR on schedule Signed-off-by: Fernando Fernández <[email protected]> * Commit .sh file as executable, so preparation is not needed at runtime Signed-off-by: Fernando Fernández <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Adam Warner <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Fernando Fernández <[email protected]> Co-authored-by: Adam Warner <[email protected]>
* Remove dangling images from GHCR on schedule Signed-off-by: Fernando Fernández <[email protected]> * Commit .sh file as executable, so preparation is not needed at runtime Signed-off-by: Fernando Fernández <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Adam Warner <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Fernando Fernández <[email protected]> Co-authored-by: Adam Warner <[email protected]>
* Remove dangling images from GHCR on schedule Signed-off-by: Fernando Fernández <[email protected]> * Commit .sh file as executable, so preparation is not needed at runtime Signed-off-by: Fernando Fernández <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Adam Warner <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Fernando Fernández <[email protected]> Co-authored-by: Adam Warner <[email protected]>
* Remove dangling images from GHCR on schedule Signed-off-by: Fernando Fernández <[email protected]> * Commit .sh file as executable, so preparation is not needed at runtime Signed-off-by: Fernando Fernández <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Adam Warner <[email protected]> * Update .github/workflows/maintenance.yml Signed-off-by: Fernando Fernández <[email protected]> Co-authored-by: Adam Warner <[email protected]>
Continuation of #940
Description
Contrary to DockerHub, GHCR keeps all the images uploaded, even those that are no longer associated to a tag. For example, updating the
latest
tags will keep the older image still around in the registry, but untagged.This new workflow runs every day at 0:00 UTC and removes all the untagged images (aka dangling images)
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist:
Needed tokens
A secret
ACCESS_TOKEN
(a PAT for the org) must be added in order to remove dangling images, with the following permissions:delete:packages
read:packages
If you prefer another name instead of
ACCESS_TOKEN
please let me know.