-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: add workflow for cleaning cache after a PR
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Clean cache | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
workflow_dispatch: | ||
|
||
jobs: | ||
cleanup: | ||
env: | ||
REPO: ${{ github.repository }} | ||
BRANCH: ${{ github.ref }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
name: Remove PR caches | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: gh extension install actions/gh-actions-cache | ||
- name: Delete caches of latest PR | ||
run: | | ||
set +e | ||
echo "Deleting caches..." | ||
for CACHE_KEY in $(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1); do | ||
gh actions-cache delete $CACHE_KEY -R $REPO -B $BRANCH --confirm | ||
done | ||
echo "Done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../.github/workflows/clean-cache.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters