File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Clean up PR caches
2+
3+ # A PR's caches are scoped to refs/pull/<n>/merge and can't be reused by any
4+ # other branch or PR, so once it closes they just waste the repo's shared
5+ # 10 GB budget until eviction. Delete on close to free space.
6+
7+ on :
8+ pull_request :
9+ types : [closed]
10+
11+ permissions : {}
12+
13+ jobs :
14+ cleanup :
15+ name : Delete caches for the closed PR
16+ runs-on : ubuntu-slim
17+ permissions :
18+ actions : write # Required to delete Actions caches
19+ env :
20+ GH_FORCE_TTY : " 120"
21+ GH_REPO : ${{ github.repository }}
22+ GH_TOKEN : ${{ github.token }}
23+ PR_REF : refs/pull/${{ github.event.pull_request.number }}/merge
24+ steps :
25+ - name : List caches scoped to this PR
26+ run : gh cache list --ref "${PR_REF}"
27+ - name : Delete caches scoped to this PR
28+ run : gh cache delete --all --ref "${PR_REF}" --succeed-on-no-caches
You can’t perform that action at this time.
0 commit comments