From ca6a38c115d8200451e822bdbd93cb978d2b63b6 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Wed, 19 Mar 2025 16:14:33 -0400 Subject: [PATCH] [ci] Parameterize branch cleanup Allow a PR number to be passed as input --- .github/workflows/shared_cleanup_branch_caches.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/shared_cleanup_branch_caches.yml b/.github/workflows/shared_cleanup_branch_caches.yml index 4df5d705da..f454dbd7af 100644 --- a/.github/workflows/shared_cleanup_branch_caches.yml +++ b/.github/workflows/shared_cleanup_branch_caches.yml @@ -6,6 +6,10 @@ on: types: - closed workflow_dispatch: + inputs: + pr_number: + required: true + type: string jobs: cleanup: @@ -27,9 +31,10 @@ jobs: 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