From 05e0a9f31ea1e1dc766693a06b79b71901f68b02 Mon Sep 17 00:00:00 2001 From: pulimsr Date: Mon, 30 Mar 2026 14:14:39 -0400 Subject: [PATCH 1/2] Test comment for merge queue validation --- .github/workflows/pull-request-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index a4a350abaa4e..c63deb2c1c08 100644 --- a/.github/workflows/pull-request-build.yml +++ b/.github/workflows/pull-request-build.yml @@ -1,4 +1,5 @@ name: Build SDK +# Test comment for merge queue PR on: pull_request: types: [ opened, synchronize, ready_for_review ] From a1c0948ef14329e403cf462082713a3e02a72957 Mon Sep 17 00:00:00 2001 From: pulimsr Date: Mon, 30 Mar 2026 16:15:35 -0400 Subject: [PATCH 2/2] Add merge_group trigger with skip optimization for first-in-queue --- .github/workflows/pull-request-build.yml | 29 ++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index c63deb2c1c08..59c8b3e694fe 100644 --- a/.github/workflows/pull-request-build.yml +++ b/.github/workflows/pull-request-build.yml @@ -1,8 +1,8 @@ name: Build SDK -# Test comment for merge queue PR on: pull_request: types: [ opened, synchronize, ready_for_review ] + merge_group: concurrency: group: start-pull-request-build-${{ github.ref }} @@ -16,7 +16,7 @@ env: jobs: aws-sdk-pr-build: - if: github.event.pull_request.draft == false + if: github.event.pull_request.draft == false || github.event_name == 'merge_group' runs-on: ubuntu-latest permissions: id-token: write @@ -24,7 +24,26 @@ jobs: pull-requests: write contents: read steps: + - name: Check if merge queue build is needed + if: github.event_name == 'merge_group' + id: queue-check + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + BASE_SHA="${{ github.event.merge_group.base_sha }}" + BASE_REF="${{ github.event.merge_group.base_ref }}" + # base_ref is in refs/heads/ format, strip prefix for API call + BRANCH_NAME="${BASE_REF#refs/heads/}" + TARGET_SHA=$(gh api repos/${{ github.repository }}/git/ref/heads/${BRANCH_NAME} --jq '.object.sha') + if [ "$BASE_SHA" == "$TARGET_SHA" ]; then + echo "skip=true" >> "$GITHUB_OUTPUT" + echo "First in queue — PR build already validated this combination, skipping." + else + echo "skip=false" >> "$GITHUB_OUTPUT" + echo "Not first in queue — merge group includes changes from other PRs, build needed." + fi - name: Configure AWS Credentials + if: steps.queue-check.outputs.skip != 'true' uses: aws-actions/configure-aws-credentials@main with: role-to-assume: ${{ env.IAM_ROLE_ARN }} @@ -33,15 +52,17 @@ jobs: aws-region: us-west-2 role-duration-seconds: 7200 - name: Download Build Script + if: steps.queue-check.outputs.skip != 'true' 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: Build + if: steps.queue-check.outputs.skip != 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPO: ${{ github.repository }} - HEAD_REF: ${{ github.event.pull_request.head.ref }} - PR_NUMBER: ${{ github.event.pull_request.number }} + HEAD_REF: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + PR_NUMBER: ${{ github.event.pull_request.number || '0' }} RUN_ID: ${{ github.run_id }} run: | ./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION \