Skip to content

Prune GHCR

Prune GHCR #128

Workflow file for this run

name: Prune GHCR
on:
pull_request:
types: [closed]
schedule:
- cron: "20 4 * * 0"
workflow_dispatch:
env:
CONTAINER_NAME: msmart-ng
jobs:
prune-pr-images:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: vlaurin/[email protected]
with:
container: ${{ env.CONTAINER_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
prune-tags-regexes: ^pr-${{github.event.pull_request.number}}
# dry-run: true
prune-old-images:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: vlaurin/[email protected]
with:
container: ${{ env.CONTAINER_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
# Keep PRs, releases, latest and edge
keep-tags-regexes: |
^pr-
^\d+\.\d+\.\d+
keep-tags: |
edge
latest
# dry-run: true
- uses: dataaxiom/ghcr-cleanup-action@v1
with:
package: ${{ env.CONTAINER_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
# dry-run: true
validate: true