Repository navigation
Cleanup caches #1
This file contains hidden or 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: Cleanup caches | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Flush all caches | |
| run: | | |
| echo "Fetching list of all cache keys" | |
| cacheKeys=$(gh cache list --limit 100 --json id --jq '.[].id') | |
| set +e | |
| echo "Deleting all caches..." | |
| for cacheKey in $cacheKeys | |
| do | |
| gh cache delete $cacheKey | |
| done | |
| echo "Done" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} |