Added a workflow to clear up all cache

Signed-off-by: mr. m  <91018726+mauro-balades@users.noreply.github.com>
This commit is contained in:
mr. m
2025-04-03 03:45:39 -07:00
committed by GitHub
parent f84e994b50
commit b7e1e26c14

24
.github/workflows/clear-all-cache.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: cleanup all caches
on:
workflow_dispatch:
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup
run: |
echo "Fetching list of cache key"
cacheKeysForPR=$(gh cache list --limit 100 --json id --jq '.[].id')
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh cache delete $cacheKey
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
GH_REPO: ${{ github.repository }}