Skip to content

Commit 9954104

Browse files
authored
[ci] Parameterize branch cleanup (#32677)
Allow a PR number to be passed as input
1 parent 2089052 commit 9954104

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/shared_cleanup_branch_caches.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
types:
77
- closed
88
workflow_dispatch:
9+
inputs:
10+
pr_number:
11+
required: true
12+
type: string
913

1014
jobs:
1115
cleanup:
@@ -23,13 +27,13 @@ jobs:
2327
2428
## Setting this to not fail the workflow while deleting cache keys.
2529
set +e
26-
echo "Deleting caches..."
2730
for cacheKey in $cacheKeysForPR
2831
do
2932
gh cache delete $cacheKey
33+
echo "Deleting $cacheKey"
3034
done
3135
echo "Done"
3236
env:
3337
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3438
GH_REPO: ${{ github.repository }}
35-
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
39+
BRANCH: refs/pull/${{ inputs.pr_number || github.event.pull_request.number }}/merge

0 commit comments

Comments
 (0)