Skip to content

Purge old ghcr.io test images periodically #27

Purge old ghcr.io test images periodically

Purge old ghcr.io test images periodically #27

Workflow file for this run

name: 'Purge old ghcr.io test images periodically'
on:
workflow_dispatch:
inputs:
dry_run:
type: boolean
default: true
description: 'Do a dry run?'
schedule:
- cron: '0 5 * * *' # at 05:00 UTC every day
permissions:
packages: write
jobs:
clean:
runs-on: ubuntu-latest
name: Delete old test images
steps:
- uses: snok/container-retention-policy@4f22ef80902ad409ed55a99dc5133cc1250a0d03 # v3.0.0
with:
account: ${{ (github.repository_owner == github.actor) && 'user' || github.repository_owner }}
token: ${{ secrets.GITHUB_TOKEN }}
image-names: |
${{ github.event.repository.name }}/workbench-images
image-tags: '*'
cut-off: '3w'
dry-run: ${{ inputs.dry_run || false }}
env:
RUST_BACKTRACE: 1