Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 86bae72

Browse files
thomasjpfanglemaitre
authored andcommitted
MNT Fixes doc building on PR (#23508)
1 parent e73127d commit 86bae72

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/trigger-hosting.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ jobs:
2323
EVENT: ${{ github.event.workflow_run.event }}
2424
RUN_ID: ${{ github.event.workflow_run.id }}
2525
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
26-
PULL_REQUEST_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
26+
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
27+
REPO_NAME: ${{ github.event.workflow_run.head_repository.full_name }}
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build_tools/github/trigger_hosting.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ GITHUB_RUN_URL=https://nightly.link/$GITHUB_REPOSITORY/actions/runs/$RUN_ID
77

88
if [ "$EVENT" == pull_request ]
99
then
10+
PULL_REQUEST_NUMBER=$(curl \
11+
-H "Accept: application/vnd.github.v3+json" \
12+
-H "Authorization: token $GITHUB_TOKEN" \
13+
https://api.github.com/repos/$REPO_NAME/commits/$COMMIT_SHA/pulls 2>/dev/null \
14+
| jq '.[0].number')
1015
BRANCH=pull/$PULL_REQUEST_NUMBER/head
1116
else
1217
BRANCH=$HEAD_BRANCH

0 commit comments

Comments
 (0)