Skip to content

Commit

Permalink
ci: auto delete cache (OpenAtomFoundation#2232)
Browse files Browse the repository at this point in the history
  • Loading branch information
baerwang committed Dec 21, 2023
1 parent 31b9380 commit 0d3a26f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/clean-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Cleanup Caches By a Branch
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
for cacheKey in $(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm &
done
wait
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge

0 comments on commit 0d3a26f

Please sign in to comment.