We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31b9380 commit 0d3a26fCopy full SHA for 0d3a26f
.github/workflows/clean-cache.yml
@@ -0,0 +1,22 @@
1
+name: Cleanup Caches By a Branch
2
+on:
3
+ pull_request:
4
+ types:
5
+ - closed
6
+
7
+jobs:
8
+ cleanup:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Cleanup
12
+ run: |
13
+ gh extension install actions/gh-actions-cache
14
+ for cacheKey in $(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
15
+ do
16
+ gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm &
17
+ done
18
+ wait
19
+ env:
20
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21
+ REPO: ${{ github.repository }}
22
+ BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
0 commit comments