From 5d6be127320a72561c80b33e038f343103f07868 Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Sat, 13 Jul 2024 14:10:13 -0400 Subject: [PATCH] workflows/vendor-gems: handle input string more robustly See also: Homebrew/actions#562. --- .github/workflows/vendor-gems.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vendor-gems.yml b/.github/workflows/vendor-gems.yml index 472704d576..621ee9a573 100644 --- a/.github/workflows/vendor-gems.yml +++ b/.github/workflows/vendor-gems.yml @@ -58,7 +58,7 @@ jobs: id: checkout if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' run: | - gh pr checkout '${{ github.event.pull_request.number || github.event.inputs.pull_request }}' + gh pr checkout "${PR}" branch="$(git branch --show-current)" echo "branch=${branch}" >> "$GITHUB_OUTPUT" @@ -66,6 +66,7 @@ jobs: gem_name="$(echo "${branch}" | sed -E 's|.*/||;s|(.*)-.*$|\1|')" echo "gem_name=${gem_name}" >> "$GITHUB_OUTPUT" env: + PR: ${{ github.event.pull_request.number || github.event.inputs.pull_request }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}