Skip to content

Commit

Permalink
Merge pull request #6 from erikgb/try-use-bot-token-on-clean-ghcr
Browse files Browse the repository at this point in the history
fix: try using Statnett BOT to overcome GHCR authorization issues
  • Loading branch information
erikgb authored Oct 2, 2023
2 parents 226c554 + 07cd155 commit 6d05ba1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/clean-ghcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,24 @@ on:
type: string
default: A week ago UTC
description: The timezone-aware datetime you want to delete container versions that are older than.
secrets:
STATNETT_BOT_APP_ID:
required: true
STATNETT_BOT_PRIVATE_KEY:
required: true

jobs:
clean-ghcr:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- id: token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.STATNETT_BOT_APP_ID }}
private_key: ${{ secrets.STATNETT_BOT_PRIVATE_KEY }}

- name: Delete untagged container images according to cut-off
uses: snok/container-retention-policy@v2
with:
Expand All @@ -29,4 +40,4 @@ jobs:
account-type: org
org-name: statnett
untagged-only: true
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.token.outputs.token }}

0 comments on commit 6d05ba1

Please sign in to comment.