Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: migrate clean-ghcr workflow to use GH token #50

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions .github/workflows/clean-ghcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,10 @@ name: Delete Obsolete GHCR Images
on:
workflow_call:
inputs:
image-names:
type: string
required: true
description: |
The names of the container images to delete old versions for.
Takes one or several container image names as a comma separated list, and supports wildcards.
cut-off:
type: string
default: A week ago UTC
description: The timezone-aware datetime you want to delete container versions that are older than.
secrets:
PAT:
required: true
description: |
You need to pass a (classic) personal access token (PAT) with access to the container registry.
Specifically, you need to grant it the following scopes: read:packages and delete:packages.

permissions: {}
jobs:
Expand All @@ -30,11 +18,10 @@ jobs:
- name: Delete untagged container images according to cut-off
uses: snok/container-retention-policy@b56f4ff7539c1f94f01e5dc726671cd619aa8072 # v2.2.1
with:
image-names: ${{ inputs.image-names }}
image-names: ${{ github.event.repository.name }}
cut-off: ${{ inputs.cut-off }}
account-type: org
org-name: statnett
untagged-only: true
# FIXME: Remove requirement for classic PAT when available
# See https://github.com/snok/container-retention-policy/issues/27
token: ${{ secrets.PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
token-type: github-token
Loading