From da02a64d7b853907a455e27f3acfa56d0b797f6d Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 09:29:53 -0800 Subject: [PATCH 01/11] Allow manual trigger --- .github/workflows/pull-request-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index 9cbe7a9c7ca..3200e593d72 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -20,7 +20,7 @@ env: jobs: aws-sdk-pr-build: - if: github.event.review.state == 'approved' + if: ${{ github.event_name == 'workflow_dispatch' || github.event.review.state == 'approved' }} runs-on: ubuntu-latest permissions: id-token: write From c75761ebce7b969ddbb10ac31a1de7c333ccde6d Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 09:50:42 -0800 Subject: [PATCH 02/11] Add fallback head ref --- .github/workflows/pull-request-build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index 3200e593d72..173c7d75176 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -4,6 +4,7 @@ on: types: [ submitted ] branches: [ version-3 ] workflow_dispatch: + branches: [ ** ] concurrency: group: start-pull-request-build-${{ github.ref }} @@ -43,7 +44,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPO: ${{ github.repository }} - HEAD_REF: ${{ github.event.pull_request.head.ref }} + HEAD_REF: ${{ github.event.pull_request.head.ref || github.ref_name }} PR_NUMBER: ${{ github.event.pull_request.number }} RUN_ID: ${{ github.run_id }} run: | From 0b0a69df65f030f19aae3b19e2e8fe1e874877b3 Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 09:51:27 -0800 Subject: [PATCH 03/11] Remove bad config --- .github/workflows/pull-request-build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index 173c7d75176..e2082440297 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -4,7 +4,6 @@ on: types: [ submitted ] branches: [ version-3 ] workflow_dispatch: - branches: [ ** ] concurrency: group: start-pull-request-build-${{ github.ref }} From 0e4749c48d87f4e6abdf96b0e2c654364038d241 Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 09:52:55 -0800 Subject: [PATCH 04/11] Fallback PR value --- .github/workflows/pull-request-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index e2082440297..d80a34eaa41 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -44,7 +44,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPO: ${{ github.repository }} HEAD_REF: ${{ github.event.pull_request.head.ref || github.ref_name }} - PR_NUMBER: ${{ github.event.pull_request.number }} + PR_NUMBER: ${{ github.event.pull_request.number || '' }} RUN_ID: ${{ github.run_id }} run: | ./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION \ From 1a35c097c8e9bd37ab965e40c7a7dc18a8f519af Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 09:55:18 -0800 Subject: [PATCH 05/11] Add step to retrieve PR number for manual trigger --- .github/workflows/pull-request-build.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index d80a34eaa41..423d1924bc8 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -39,12 +39,20 @@ jobs: run: | aws s3 cp s3://aws-sdk-builds-github-assets-prod-us-west-2/$SCRIPT_LOCATION ./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION --no-progress chmod +x ./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION + - name: Get PR Number + id: pr + if: github.event_name == 'workflow_dispatch' + run: | + PR_NUMBER=$(gh pr list --head "${{ github.ref_name }}" --json number --jq '.[0].number // ""') + echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPO: ${{ github.repository }} HEAD_REF: ${{ github.event.pull_request.head.ref || github.ref_name }} - PR_NUMBER: ${{ github.event.pull_request.number || '' }} + PR_NUMBER: ${{ github.event.pull_request.number || steps.pr.outputs.number }} RUN_ID: ${{ github.run_id }} run: | ./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION \ From 5cd0ea5a1a85ddd1c8077e37ea411053bbc60878 Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 09:56:57 -0800 Subject: [PATCH 06/11] Add step to retrieve repo --- .github/workflows/pull-request-build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index 423d1924bc8..0ebfd41cdee 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -35,6 +35,9 @@ jobs: role-session-name: PullRequestBuildGitHubAction role-duration-seconds: '$ROLE_SESSION_DURATION_SECONDS' aws-region: us-west-2 + - name: Checkout + if: github.event_name == 'workflow_dispatch' + uses: actions/checkout@v4 - name: Download Build Script run: | aws s3 cp s3://aws-sdk-builds-github-assets-prod-us-west-2/$SCRIPT_LOCATION ./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION --no-progress From c3b7ac6364d45db01c2e5f552cdc09acf670aca0 Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 10:59:27 -0800 Subject: [PATCH 07/11] Fix pr number --- .github/workflows/pull-request-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index 0ebfd41cdee..a4715639d70 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -46,7 +46,7 @@ jobs: id: pr if: github.event_name == 'workflow_dispatch' run: | - PR_NUMBER=$(gh pr list --head "${{ github.ref_name }}" --json number --jq '.[0].number // ""') + PR_NUMBER=$(gh pr list --repo "${{ github.repository }}" --head "${{ github.ref_name }}" --json number --jq '.[0].number // ""') echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1790a097fc0919fa31072bf3d54a803c0add0546 Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 11:02:59 -0800 Subject: [PATCH 08/11] Add logs --- .github/workflows/pull-request-build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index a4715639d70..a6e237c8d99 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -46,7 +46,10 @@ jobs: id: pr if: github.event_name == 'workflow_dispatch' run: | + echo "Looking for PR with head branch: ${{ github.ref_name }}" + gh pr list --repo "${{ github.repository }}" --head "${{ github.ref_name }}" --json number,headRefName PR_NUMBER=$(gh pr list --repo "${{ github.repository }}" --head "${{ github.ref_name }}" --json number --jq '.[0].number // ""') + echo "Found PR number: $PR_NUMBER" echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From da3ee0524fd591145966d3e37537318d3ae94d1c Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 11:04:44 -0800 Subject: [PATCH 09/11] More logs --- .github/workflows/pull-request-build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index a6e237c8d99..62189c25e2d 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -47,10 +47,10 @@ jobs: if: github.event_name == 'workflow_dispatch' run: | echo "Looking for PR with head branch: ${{ github.ref_name }}" - gh pr list --repo "${{ github.repository }}" --head "${{ github.ref_name }}" --json number,headRefName - PR_NUMBER=$(gh pr list --repo "${{ github.repository }}" --head "${{ github.ref_name }}" --json number --jq '.[0].number // ""') + gh pr list --repo "${{ github.repository }}" --state all --json number,headRefName --jq '.[] | select(.headRefName=="${{ github.ref_name }}")' + PR_NUMBER=$(gh pr list --repo "${{ github.repository }}" --state all --json number,headRefName --jq '.[] | select(.headRefName=="${{ github.ref_name }}") | .number' | head -1) echo "Found PR number: $PR_NUMBER" - echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT + echo "number=${PR_NUMBER:-}" >> $GITHUB_OUTPUT env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build From b836bf39b471cfe01232fef6647ca63e5536ebca Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 11:07:28 -0800 Subject: [PATCH 10/11] More logs --- .github/workflows/pull-request-build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index 62189c25e2d..810dd6dd344 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -47,7 +47,9 @@ jobs: if: github.event_name == 'workflow_dispatch' run: | echo "Looking for PR with head branch: ${{ github.ref_name }}" - gh pr list --repo "${{ github.repository }}" --state all --json number,headRefName --jq '.[] | select(.headRefName=="${{ github.ref_name }}")' + echo "All PRs:" + gh pr list --repo "${{ github.repository }}" --state all --limit 20 --json number,headRefName,baseRefName + echo "Searching for match..." PR_NUMBER=$(gh pr list --repo "${{ github.repository }}" --state all --json number,headRefName --jq '.[] | select(.headRefName=="${{ github.ref_name }}") | .number' | head -1) echo "Found PR number: $PR_NUMBER" echo "number=${PR_NUMBER:-}" >> $GITHUB_OUTPUT From d04e3fa9252f40adb2febb6b4a577687f0ef867e Mon Sep 17 00:00:00 2001 From: Richard Wang Date: Wed, 14 Jan 2026 11:10:24 -0800 Subject: [PATCH 11/11] Simplify --- .github/workflows/pull-request-build.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml index 810dd6dd344..b544e92b340 100644 --- a/.github/workflows/pull-request-build.yaml +++ b/.github/workflows/pull-request-build.yaml @@ -46,12 +46,7 @@ jobs: id: pr if: github.event_name == 'workflow_dispatch' run: | - echo "Looking for PR with head branch: ${{ github.ref_name }}" - echo "All PRs:" - gh pr list --repo "${{ github.repository }}" --state all --limit 20 --json number,headRefName,baseRefName - echo "Searching for match..." - PR_NUMBER=$(gh pr list --repo "${{ github.repository }}" --state all --json number,headRefName --jq '.[] | select(.headRefName=="${{ github.ref_name }}") | .number' | head -1) - echo "Found PR number: $PR_NUMBER" + PR_NUMBER=$(gh pr list --repo "${{ github.repository }}" --state all --head "${{ github.ref_name }}" --json number --jq '.[0].number // ""') echo "number=${PR_NUMBER:-}" >> $GITHUB_OUTPUT env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}