This commit is contained in:
Maxime Desroches 2024-11-18 21:39:54 -08:00
parent 3ac9208364
commit 3e80e2d850
1 changed files with 22 additions and 0 deletions

22
.github/workflows/delete_pr_cache.yaml vendored Normal file
View File

@ -0,0 +1,22 @@
name: cache deleter
on:
pull_request_target:
types:
- closed
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup
run: |
keys=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id')
set +e
for key in $keys
do
gh cache delete $key
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge