Skip to content

Commit 07d2e81

Browse files
Revert "fix: remove cache which are not in default branch (#11)"
This reverts commit 969e21a.
1 parent da126d8 commit 07d2e81

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

action.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@ runs:
99
- shell: bash
1010
run: |
1111
gh extension install actions/gh-actions-cache
12-
defaultBranch=$(gh api repos/${ github.repository } --jq '.default_branch')
13-
gh actions-cache list --limit 100 | grep -v "refs/heads/${defaultBranch}" | cut -f 1 | xargs -I{} gh actions-cache delete --confirm {}
12+
13+
mergedPRNumbers=$(gh pr list --state merged --json number | jq .[].number)
14+
15+
for prNumber in $mergedPRNumbers
16+
do
17+
gh actions-cache list -B refs/pull/$prNumber/merge | cut -f 1 | xargs -I{} gh actions-cache delete --confirm {}
18+
done

0 commit comments

Comments
 (0)