Add workflow to prune old GHCR images

This workflow allows for manual execution to prune old images from the GitHub Container Registry, keeping the latest and a specified number of tagged images.
This commit is contained in:
Alanis
2026-03-08 01:28:25 +00:00
committed by GitHub
parent 1df8d79a0b
commit fac57b0fad

21
.github/workflows/prune.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Prune Old GHCR Images
on:
#schedule:
# - cron: '0 0 * * 0' # Runs at 00:00 every Sunday
workflow_dispatch: # Allows you to run it manually from the Actions tab
jobs:
prune:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Cleanup old images
uses: dataaxiom/ghcr-cleanup-action@cd0cdb900b5dbf3a6f2cc869f0dbb0b8211f50c4 # v1.0.16
with:
package: autoglue # Tell the action exactly which lowercase package to look for
exclude-tags: latest,main,v*
keep-n-tagged: 5
delete-untagged: true
delete-partial-images: true