Cleanup GitHub Container Registry #550
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: 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 |