File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 23
23
EVENT : ${{ github.event.workflow_run.event }}
24
24
RUN_ID : ${{ github.event.workflow_run.id }}
25
25
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 }}
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ GITHUB_RUN_URL=https://nightly.link/$GITHUB_REPOSITORY/actions/runs/$RUN_ID
7
7
8
8
if [ " $EVENT " == pull_request ]
9
9
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' )
10
15
BRANCH=pull/$PULL_REQUEST_NUMBER /head
11
16
else
12
17
BRANCH=$HEAD_BRANCH
You can’t perform that action at this time.
0 commit comments