Skip to content

Commit c4664fa

Browse files
committed
Fix PR build workflow script
1 parent eeb61ca commit c4664fa

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020

2121
jobs:
2222
aws-sdk-pr-build:
23-
if: github.event.pull_request.draft == false
23+
if: github.event_name == 'merge_group' || github.event.pull_request.draft == false
2424
runs-on: ubuntu-latest
2525
permissions:
2626
id-token: write
@@ -42,11 +42,15 @@ jobs:
4242
- name: Build
4343
env:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
HEAD_REF: ${{ github.event.pull_request.head.ref }}
45+
HEAD_REF: ${{ github.event.pull_request.head.ref || github.ref_name }}
46+
PR_NUMBER: ${{ github.event.pull_request.number }}
4647
run: |
48+
if [ -z "$PR_NUMBER" ] && [[ "$HEAD_REF" =~ ^gh-readonly-queue/.+/pr-([0-9]+)- ]]; then
49+
PR_NUMBER="${BASH_REMATCH[1]}"
50+
fi
4751
./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION \
4852
--repo "${{ github.repository }}" \
4953
--branch "$HEAD_REF" \
50-
--pr-number "${{ github.event.pull_request.number }}" \
54+
--pr-number "$PR_NUMBER" \
5155
--run-id "${{ github.run_id }}"
5256
timeout-minutes: 120

0 commit comments

Comments
 (0)