Skip to content

Container Image Garbage Collection #14

Container Image Garbage Collection

Container Image Garbage Collection #14

Workflow file for this run

name: Container Image Garbage Collection
on:
workflow_dispatch:
inputs:
retention-days:
description: "Delete container images older than this many days"
required: false
default: "14"
type: string
dry-run:
description: "Dry run mode - don't actually delete anything"
required: false
default: false
type: boolean
schedule:
# Run weekly on Sundays at 2 AM UTC
- cron: '0 2 * * 0'
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Delete old container images
uses: snok/container-retention-policy@v3.0.1
with:
account: ${{ github.repository_owner }}
token: ${{ secrets.GITHUB_TOKEN }}
cut-off: ${{ github.event.inputs.retention-days || '14' }}d
dry-run: ${{ github.event.inputs.dry-run || false }}