Skip to content

Commit b755cab

Browse files
committed
Fix merge
1 parent ce71a04 commit b755cab

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/pull-request-build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,18 @@ jobs:
4343
- name: Build
4444
env:
4545
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
46+
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
47+
HEAD_REF: ${{ github.event.pull_request.head.ref || github.ref }}
48+
PR_NUMBER: ${{ github.event.pull_request.number }}
4749
run: |
50+
# For merge_group events, extract the PR number from the ref name
51+
# (e.g. gh-readonly-queue/main/pr-1234-<sha>)
4852
if [ -z "$PR_NUMBER" ] && [[ "$HEAD_REF" =~ ^gh-readonly-queue/.+/pr-([0-9]+)- ]]; then
4953
PR_NUMBER="${BASH_REMATCH[1]}"
5054
fi
5155
./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION \
5256
--repo "${{ github.repository }}" \
5357
--branch "$HEAD_SHA" \
54-
--pr-number "${{ github.event.pull_request.number }}" \
58+
--pr-number "$PR_NUMBER" \
5559
--run-id "${{ github.run_id }}"
5660
timeout-minutes: 120

0 commit comments

Comments
 (0)