fix prune workflow
Docker / build (push) Has been cancelled Details

This commit is contained in:
Chris W 2024-01-07 12:20:48 -07:00
parent 5b9e534fff
commit 4baa348b30
1 changed files with 26 additions and 17 deletions

View File

@ -1,26 +1,35 @@
name: Prune Containers name: Prune containers
on: on:
schedule: workflow_call:
- cron: '33 6 * * *' # 6:33 UTC every day inputs:
workflow_dispatch: container:
type: string
env: required: true
package_name: paste69 description: "Container name without organization"
older-than:
type: number
default: 14
description: "Prune containers older than X days"
keep-last:
type: number
default: 3
description: "Keep last X containers"
secrets:
token:
required: true
description: "Private access token with packages read/delete permission"
jobs: jobs:
build: prune:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: write-all
steps: steps:
- name: Prune - name: Prune GHCR containers
uses: vlaurin/action-ghcr-prune@v0.5.0 uses: vlaurin/action-ghcr-prune@v0.5.0
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.TOKEN }}
organization: ${{ github.repository_owner }} organization: meikooy
container: ${{ env.package_name }} container: ${{ inputs.container }}
dry-run: true # Dry-run first, then change to `false` keep-younger-than: ${{ inputs.older-than }}
keep-younger-than: 2 # days keep-last: ${{ inputs.keep-last }}
keep-last: 2
prune-untagged: true prune-untagged: true