Skip to content

Scheduled: Cleanup

Scheduled: Cleanup #21

name: "Scheduled: Cleanup"
# This workflows uses a separate PAT (GHCR_OPERATIONS_TOKEN) with the following permissions:
# - read:packages
# - delete:packages
# I wasn't able to get the workflow to work with a short-lived application token,
# as it wasn't able to read the packages no matter what permissions I gave it.
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * 1"
jobs:
cleanup:
name: Cleanup untagged images
runs-on: ubuntu-latest
steps:
- name: Delete all containers from package without tags
uses: Chizkiyahu/delete-untagged-ghcr-action@v3
with:
token: "${{ secrets.GHCR_OPERATIONS_TOKEN }}"
repository_owner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
untagged_only: true
owner_type: user
except_untagged_multiplatform: true