Merge pull request #17698 from Homebrew/better-input-handling
workflows/vendor-gems: handle input string more robustly
This commit is contained in:
commit
7c90c2df92
3
.github/workflows/vendor-gems.yml
vendored
3
.github/workflows/vendor-gems.yml
vendored
@ -58,7 +58,7 @@ jobs:
|
|||||||
id: checkout
|
id: checkout
|
||||||
if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch'
|
||||||
run: |
|
run: |
|
||||||
gh pr checkout '${{ github.event.pull_request.number || github.event.inputs.pull_request }}'
|
gh pr checkout "${PR}"
|
||||||
|
|
||||||
branch="$(git branch --show-current)"
|
branch="$(git branch --show-current)"
|
||||||
echo "branch=${branch}" >> "$GITHUB_OUTPUT"
|
echo "branch=${branch}" >> "$GITHUB_OUTPUT"
|
||||||
@ -66,6 +66,7 @@ jobs:
|
|||||||
gem_name="$(echo "${branch}" | sed -E 's|.*/||;s|(.*)-.*$|\1|')"
|
gem_name="$(echo "${branch}" | sed -E 's|.*/||;s|(.*)-.*$|\1|')"
|
||||||
echo "gem_name=${gem_name}" >> "$GITHUB_OUTPUT"
|
echo "gem_name=${gem_name}" >> "$GITHUB_OUTPUT"
|
||||||
env:
|
env:
|
||||||
|
PR: ${{ github.event.pull_request.number || github.event.inputs.pull_request }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
|
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user