Prune ghcr.io container images #72
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Prune ghcr.io container images | |
on: | |
schedule: | |
# run once a day | |
- cron: '0 2 * * *' | |
# Temporary to test | |
pull_request: | |
permissions: {} | |
jobs: | |
prune: | |
permissions: | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- run: | | |
pip install requests | |
# remove containers older than 14 days and only generated by testing workflow | |
python .github/scripts/ghcr-prune.py --token ${{ secrets.GITHUB_TOKEN }} --org esmci --name cime --age 14 --filter sha- --untagged |