@samitouri / QOS-React / commits / 995410463a

[ci] Parameterize branch cleanup (#32677)

Allow a PR number to be passed as input

lauren committed Mar 19, 2025 at 16:39 UTC 995410463a0d74e43d91816bcda5f10cff82a14a
1 file changed +6 -2
.github/workflows/shared_cleanup_branch_caches.yml
+6 -2
@@ -6,6 +6,10 @@ on:
6 types:
7 - closed
8 workflow_dispatch:
9 + inputs:
10 + pr_number:
11 + required: true
12 + type: string
13
14 jobs:
15 cleanup:
@@ -23,13 +27,13 @@ jobs:
27
28 ## Setting this to not fail the workflow while deleting cache keys.
29 set +e
26 - echo "Deleting caches..."
30 for cacheKey in $cacheKeysForPR
31 do
32 gh cache delete $cacheKey
33 + echo "Deleting $cacheKey"
34 done
35 echo "Done"
36 env:
37 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 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