Skip to content

Commit 8ceb451

Browse files
authored
chore(ci): integrate catapult build workflow for PRs (#7286)
1 parent 11d3427 commit 8ceb451

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build SDK
2+
on:
3+
pull_request_review:
4+
types: [ submitted ]
5+
branches: [ main ]
6+
7+
concurrency:
8+
group: start-pull-request-build-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
env:
12+
IAM_ROLE_ARN: 'arn:aws:iam::088667348242:role/AwsSdkJsV3GitHubRole'
13+
DOWNLOAD_FOLDER: '.build-scripts/'
14+
SCRIPT_LOCATION: 'workflows/start-pull-request-build/pull-request-build-v1.sh'
15+
16+
jobs:
17+
aws-sdk-pr-build:
18+
if: github.event.review.state == 'approved'
19+
runs-on: ubuntu-latest
20+
permissions:
21+
id-token: write
22+
issues: write
23+
pull-requests: write
24+
contents: read
25+
steps:
26+
- name: Configure AWS Credentials
27+
uses: aws-actions/configure-aws-credentials@v4
28+
with:
29+
role-to-assume: ${{ env.IAM_ROLE_ARN }}
30+
role-session-name: PullRequestBuildGitHubAction
31+
aws-region: us-west-2
32+
- name: Download Build Script
33+
run: |
34+
aws s3 cp s3://aws-sdk-builds-github-assets-prod-us-west-2/$SCRIPT_LOCATION ./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION --no-progress
35+
chmod +x ./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION
36+
- name: Build
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
run: |
40+
./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION \
41+
--repo "${{ github.repository }}" \
42+
--branch "${{ github.event.pull_request.head.ref }}" \
43+
--pr-number "${{ github.event.pull_request.number }}" \
44+
--run-id "${{ github.run_id }}"
45+
timeout-minutes: 510 # 8.5 hours

0 commit comments

Comments
 (0)