-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit e334889.
- Loading branch information
Showing
4 changed files
with
68 additions
and
33 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
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,40 @@ | ||
name: CleanUpCachePostPR | ||
|
||
on: | ||
workflow_run: | ||
workflows: [PostPR] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
CleanUpCcacheCachePostPR: | ||
name: Clean Up Ccahe Cache Post PR | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: write | ||
contents: read | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Clean up ccahe | ||
run: | | ||
gh extension install actions/gh-actions-cache | ||
REPO=${{ github.repository }} | ||
gh run download ${{ github.event.workflow_run.id }} -n pr_number | ||
pr_number=`cat pr_number.txt` | ||
BRANCH=refs/pull/${pr_number}/merge | ||
# Setting this to not fail the workflow while deleting cache keys. | ||
set +e | ||
keys=$(gh actions-cache list -L 100 -R $REPO -B $BRANCH | cut -f 1) | ||
# $keys might contain spaces. Thus we set IFS to \n. | ||
IFS=$'\n' | ||
for k in $keys | ||
do | ||
gh actions-cache delete "$k" -R $REPO -B $BRANCH --confirm | ||
done | ||
unset IFS |
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
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