Skip to content

Commit

Permalink
ci: reuse clean GHCR workflow (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgb authored Oct 2, 2023
1 parent c41a5a4 commit 612a10e
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/clean-ghcr.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
---
name: Delete obsolete container images
name: Delete Obsolete GHCR Images
on:
schedule:
- cron: "0 1 * * *" # every day at midnight
workflow_dispatch:
permissions:
contents: read

jobs:
clean-ghcr:
name: Delete obsolete container images
if: ${{ github.repository == 'statnett/image-scanner-operator' }}
trigger:
uses: statnett/workflows/.github/workflows/clean-ghcr.yaml@main
with:
image-names: ${{ github.event.repository.name }}
secrets:
PAT: ${{ secrets.BOT_PAT }}
permissions:
packages: write # for snok/container-retention-policy to delete images
runs-on: ubuntu-latest
steps:
- name: Delete untagged container images older than a week
uses: snok/container-retention-policy@04c70fd030033036d69c0057e0d125bf25820544 # v2.1.2
with:
image-names: image-scanner-operator
cut-off: A week ago UTC
account-type: org
org-name: statnett
untagged-only: true
token: ${{ secrets.BOT_PAT }}
packages: write

0 comments on commit 612a10e

Please sign in to comment.