Skip to content

Commit 171f5d0

Browse files
committed
Fix cleanup workflow.
1 parent e4ac851 commit 171f5d0

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

.github/workflows/cleanup.yaml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,10 @@ jobs:
2222
cleanup:
2323
runs-on: ubuntu-latest
2424
steps:
25+
- uses: actions/checkout@v4
2526
- name: Cleanup
26-
run: |
27-
echo "Fetching list of cache key"
28-
cacheKeysForPR=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id')
29-
30-
## Setting this to not fail the workflow while deleting cache keys.
31-
set +e
32-
echo "Deleting caches..."
33-
for cacheKey in $cacheKeysForPR
34-
do
35-
gh cache delete $cacheKey
36-
done
37-
echo "Done"
27+
run: gh cache list --ref $BRANCH --json id --jq '.[].id' | xargs -I {} gh cache delete {}
3828
env:
3929
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4030
GH_REPO: ${{ github.repository }}
41-
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
31+
BRANCH: refs/pull/${{ github.event.number }}/merge

0 commit comments

Comments
 (0)