Skip to content

Prune Untagged Images #15

Prune Untagged Images

Prune Untagged Images #15

Workflow file for this run

on:
schedule:
- cron: '22 0 * * *' # 22 past midnight daily
workflow_dispatch:
jobs:
prune_images:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/delete-package-versions#delete-all-untagged-container-versions-except-y-latest-untagged-versions
- name: Prune untagged images from ghcr
uses: actions/delete-package-versions@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
package-name: 'src-test-workspace'
package-type: 'container'
min-versions-to-keep: 3 # ...but keep the latest n untagged images
delete-only-untagged-versions: 'true'