Skip to content

Cleanup GitHub Container Registry #550

Cleanup GitHub Container Registry

Cleanup GitHub Container Registry #550

---
name: Cleanup GitHub Container Registry
permissions: {}
on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 0 * * *'
jobs:
prune-containers:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- name: Prune ci-* containers
uses: vlaurin/action-ghcr-prune@0cf7d39f88546edd31965acba78cdcb0be14d641 # v0.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
user: ${{ github.repository_owner }}
container: ${{ github.event.repository.name }}
keep-younger-than: 1
prune-tags-regexes: |
^ci-
- name: Prune other containers
uses: vlaurin/action-ghcr-prune@0cf7d39f88546edd31965acba78cdcb0be14d641 # v0.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
user: ${{ github.repository_owner }}
container: ${{ github.event.repository.name }}
keep-younger-than: 1
keep-last: 5
prune-untagged: true