chore(workflow): update GHCR retention policy to use PAT instead of generated token

- Removed the token generation step for GitHub App authentication.
- Updated the deletion process to utilize a personal access token (PAT) for authentication.
- Maintained the functionality to delete container versions older than 30 days while keeping the 5 most recent versions.
This commit is contained in:
zhenlonghe
2025-10-24 19:27:52 +08:00
parent 6351b49991
commit f03ac833a6
+1 -8
View File
@@ -19,18 +19,11 @@ jobs:
packages: write
contents: read
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Delete old container versions (30+ days)
uses: snok/container-retention-policy@v3.0.1
with:
account: user
token: ${{ steps.generate-token.outputs.token }}
token: ${{ secrets.PAT }}
image-names: "*"
cut-off: 30d
keep-n-most-recent: 5