Fix it once and for all
This commit is contained in:
parent
4bcdb5e99b
commit
b6bc2943d3
1 changed files with 5 additions and 5 deletions
10
.github/workflows/netlify.yaml
vendored
10
.github/workflows/netlify.yaml
vendored
|
@ -18,12 +18,12 @@ jobs:
|
||||||
# forked PRs: https://docs.github.com/en/rest/reference/checks#create-a-check-run
|
# forked PRs: https://docs.github.com/en/rest/reference/checks#create-a-check-run
|
||||||
run: |
|
run: |
|
||||||
head_branch='${{github.event.workflow_run.head_repository.owner.login}}:${{github.event.workflow_run.head_branch}}'
|
head_branch='${{github.event.workflow_run.head_repository.owner.login}}:${{github.event.workflow_run.head_branch}}'
|
||||||
echo "head branch: $head_branch"
|
echo "Head branch: $head_branch"
|
||||||
pulls_uri="https://api.github.com/repos/${{ github.repository }}/pulls?head=$(jq -Rr '@uri' <<<$head_branch)"
|
head_ref='${{github.event.workflow_run.head_sha}}'
|
||||||
read -d"" pr_number head_ref < <(curl -s -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" |
|
|
||||||
jq -r '.[] | .number, .head.ref')
|
|
||||||
echo "PR number: $pr_number"
|
|
||||||
echo "Head ref: $head_ref"
|
echo "Head ref: $head_ref"
|
||||||
|
pulls_uri="https://api.github.com/repos/${{ github.repository }}/pulls?head=$(jq -Rr '@uri' <<<$head_branch)"
|
||||||
|
pr_number = $(curl -s -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" | jq -r '.[] | .number)
|
||||||
|
echo "PR number: $pr_number"
|
||||||
echo "::set-output name=prnumber::$pr_number"
|
echo "::set-output name=prnumber::$pr_number"
|
||||||
echo "::set-output name=headref::$head_ref"
|
echo "::set-output name=headref::$head_ref"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue