Prune untagged container images #1028
This file contains 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
name: Prune untagged container images | |
on: | |
workflow_run: | |
workflows: | |
[ | |
"Build and push all supported versions of the BorgBackup container image", | |
] | |
types: | |
- completed | |
workflow_dispatch: | |
jobs: | |
prune-ghcr: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete all untagged images older than a month | |
uses: snok/container-retention-policy@v2 | |
with: | |
image-names: borgbackup | |
cut-off: 1 month ago UTC | |
keep-at-least: 0 | |
untagged-only: true | |
account-type: personal | |
token: ${{ secrets.DELETE_PACKAGES_TOKEN }} | |
timestamp-to-use: updated_at |