11name : Build SDK
22on :
33 merge_group :
4- pull_request_target :
4+ pull_request :
55 push :
66 branches :
77 - master
1111 - ' docs/**'
1212
1313concurrency :
14- group : start-pull-request-build-${{ github.event.pull_request.number || github. ref }}
14+ group : start-pull-request-build-${{ github.ref }}
1515 cancel-in-progress : true
1616
1717env :
2020
2121jobs :
2222 aws-sdk-pr-build :
23- if : >
24- github.event_name != 'pull_request_target' ||
25- github.event.pull_request.draft == false
23+ if : github.event_name == 'merge_group' || github.event.pull_request.draft == false
2624 runs-on : ubuntu-latest
2725 permissions :
2826 id-token : write
2927 issues : write
3028 pull-requests : write
3129 contents : read
32- # Fork PRs, require manual approval via the "fork-ci" environment.
33- # Internal PRs and merge_group events run with no environment gate.
34- environment : >-
35- ${{
36- github.event_name == 'pull_request_target' &&
37- github.event.pull_request.head.repo.full_name != github.repository &&
38- 'fork-ci' || ''
39- }}
4030 steps :
4131 - name : Configure AWS Credentials
4232 uses : aws-actions/configure-aws-credentials@v4
4333 with :
44- role-to-assume : ${{ secrets.PR_WORKFLOW_IAM_ROLE_ARN }}
34+ role-to-assume : ${{secrets.PR_WORKFLOW_IAM_ROLE_ARN}}
4535 role-session-name : PullRequestBuildGitHubAction
4636 aws-region : us-west-2
4737 role-duration-seconds : 10800 # 3 hrs
5242 - name : Build
5343 env :
5444 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55- HEAD_REF : ${{ github.event.pull_request.head.ref || github.ref }}
45+ HEAD_REF : ${{ github.event.pull_request.head.ref || github.ref_name }}
5646 PR_NUMBER : ${{ github.event.pull_request.number }}
5747 run : |
58- # For merge_group events, extract the PR number from the ref name
59- # (e.g. gh-readonly-queue/main/pr-1234-<sha>)
6048 if [ -z "$PR_NUMBER" ] && [[ "$HEAD_REF" =~ ^gh-readonly-queue/.+/pr-([0-9]+)- ]]; then
6149 PR_NUMBER="${BASH_REMATCH[1]}"
6250 fi
6553 --branch "$HEAD_REF" \
6654 --pr-number "$PR_NUMBER" \
6755 --run-id "${{ github.run_id }}"
68- timeout-minutes : 120
56+ timeout-minutes : 120
0 commit comments