diff --git a/.github/workflows/prune.yml b/.github/workflows/prune.yml new file mode 100644 index 00000000..1ce393ab --- /dev/null +++ b/.github/workflows/prune.yml @@ -0,0 +1,40 @@ +name: Prune GHCR + +on: + schedule: + - cron: '0 0 * * *' + +permissions: + contents: write + packages: write + security-events: write + +jobs: + prune_images: + name: Prune old sparrow images + runs-on: ubuntu-latest + + steps: + + - name: Prune Images + uses: vlaurin/action-ghcr-prune@v0.5.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + organization: caas-team + container: sparrow + keep-younger-than: 7 # days + prune-untagged: true + prune-tags-regexes: | + ^commit- + SNAPSHOT-.*$ + + - name: Prune Charts + uses: vlaurin/action-ghcr-prune@v0.5.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + organization: caas-team + container: charts/sparrow + keep-younger-than: 7 # days + prune-untagged: true + prune-tags-regexes: | + commit-.*$ \ No newline at end of file