Skip to content

Commit

Permalink
GHA: url-encode branch name in pull-request search (#3541)
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh authored Dec 3, 2021
1 parent 83b24dd commit 86fb65a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/netlify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
run: |
head_branch='${{github.event.workflow_run.head_repository.owner.login}}:${{github.event.workflow_run.head_branch}}'
echo "head branch: $head_branch"
pr_number=$(curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
"https://api.github.com/repos/${{ github.repository }}/pulls?head=$head_branch" |
pulls_uri="https://api.github.com/repos/${{ github.repository }}/pulls?head=$(jq -Rr '@uri' <<<$head_branch)"
pr_number=$(curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" |
jq -r '.[] | .number')
echo "PR number: $pr_number"
echo "::set-output name=prnumber::$pr_number"
Expand Down

0 comments on commit 86fb65a

Please sign in to comment.