Skip to content

Image Retention Policy #18

Image Retention Policy

Image Retention Policy #18

name: image-retention-policy
on:
workflow_dispatch:
schedule: [{cron: '0 0 2 * *'}] # the second of every month
jobs:
clean-ghcr:
runs-on: ubuntu-latest
steps:
- name: Delete old images
uses: snok/container-retention-policy@main
with:
account-type: personal
token: ${{ secrets.PAT }}
image-names: ${{ github.event.repository.name }}
cut-off: one month ago EST
untagged-only: true
filter-include-untagged: true
keep-at-least: 5