Skip to content

Prune untagged container images #4

Prune untagged container images

Prune untagged container images #4

---
name: Prune old container images
"on":
schedule:
- cron: "17 8 * * 1-5"
workflow_dispatch: {}
jobs:
prune:
runs-on: ubuntu-latest
steps:
- name: Delete all untagged versions
uses: actions/delete-package-versions@v5
with:
package-name: "${{ github.event.repository.name }}/gitlab"
package-type: container
# never delete release versions or latest
ignore-versions: "^(v.*|latest)$"
min-versions-to-keep: 0
delete-only-untagged-versions: 'true'
- name: Delete all but latest 3 feature branch versions
uses: actions/delete-package-versions@v5
with:
package-name: "${{ github.event.repository.name }}/gitlab"
package-type: container
# never delete release versions or latest
ignore-versions: "^(v.*|latest)$"
min-versions-to-keep: 3