Prune ghcr.io container images #80
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 * * *' | |
workflow_dispatch: | |
permissions: {} | |
jobs: | |
prune: | |
permissions: | |
packages: write | |
pull-requests: read | |
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- --filter-pr --untagged |