[ci] Parameterize branch cleanup (#32677)

Allow a PR number to be passed as input
This commit is contained in:
lauren 2025-03-19 16:39:01 -04:00 committed by GitHub
parent 208905257f
commit 995410463a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,10 @@ on:
types:
- closed
workflow_dispatch:
inputs:
pr_number:
required: true
type: string
jobs:
cleanup:
@ -23,13 +27,13 @@ jobs:
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh cache delete $cacheKey
echo "Deleting $cacheKey"
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
BRANCH: refs/pull/${{ inputs.pr_number || github.event.pull_request.number }}/merge