Skip to content

Cleanup Old SAP-EE Containers #2

Cleanup Old SAP-EE Containers

Cleanup Old SAP-EE Containers #2

name: Cleanup Old SAP-EE Containers
# Token: GITHUB_TOKEN funktioniert nicht ("missing field `id`", siehe
# https://github.com/snok/container-retention-policy/issues/119). Es wird ein klassischer PAT
# benötigt. Anleitung: siehe DEVELOPER.md Abschnitt "Cleanup-Workflow (GHCR)".
on:
# Erlaube manuelles Starten über die GitHub UI
workflow_dispatch:
# Führe den Job wöchentlich aus (Sonntags um 3 Uhr morgens)
#schedule:
# - cron: '0 3 * * 0'
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Caution may have issues with multiarch images - see https://github.com/snok/container-retention-policy?tab=readme-ov-file#examples
- name: Delete old sap-ee container images
uses: snok/container-retention-policy@v3.0.1
with:
# Für Organisation: Org-Name; für User-Repos: wörtlich "user" (laut Action-Doku)
account: ${{ github.event.repository.owner.type == 'User' && 'user' || github.repository_owner }}
# Klassischer PAT mit read:packages + delete:packages (GITHUB_TOKEN funktioniert nicht)
token: ${{ secrets.GHCR_CLEANUP_TOKEN }}
image-names: sap-ee
image-tags: "dev*"
cut-off: 6w
keep-n-most-recent: 5
dry-run: true