File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Cleanup github runner caches on closed pull requests
2+ on :
3+ pull_request :
4+ types :
5+ - closed
6+
7+ jobs :
8+ cleanup :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ actions : write
12+ steps :
13+ - name : Cleanup
14+ run : |
15+ echo "Fetching list of cache keys"
16+ cacheKeysForPR=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id')
17+
18+ ## Setting this to not fail the workflow while deleting cache keys.
19+ set +e
20+ echo "Deleting caches..."
21+ for cacheKey in $cacheKeysForPR
22+ do
23+ gh cache delete $cacheKey
24+ done
25+ echo "Done"
26+ env :
27+ GH_TOKEN : ${{ github.token }}
28+ GH_REPO : ${{ github.repository }}
29+ BRANCH : refs/pull/${{ github.event.pull_request.number }}/merge
Original file line number Diff line number Diff line change 5555 with :
5656 java-version : 17
5757 distribution : adopt
58- cache : gradle
5958
6059 - name : Build framework
6160 run : pnpm build
You can’t perform that action at this time.
0 commit comments