-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: reuse clean GHCR workflow (#608)
- Loading branch information
Showing
1 changed file
with
9 additions
and
18 deletions.
There are no files selected for viewing
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
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 |