-
Notifications
You must be signed in to change notification settings - Fork 997
56 lines (53 loc) · 1.79 KB
/
pull-request-build.yml
File metadata and controls
56 lines (53 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build SDK
on:
merge_group:
pull_request:
push:
branches:
- master
paths-ignore:
- '**.md'
- '.all-contributorsrc'
- 'docs/**'
concurrency:
group: start-pull-request-build-${{ github.ref }}
cancel-in-progress: true
env:
DOWNLOAD_FOLDER: '.build-scripts/'
SCRIPT_LOCATION: 'workflows/start-pull-request-build/pull-request-build-v1.sh'
jobs:
aws-sdk-pr-build:
if: github.event_name == 'merge_group' || github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
id-token: write
issues: write
pull-requests: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{secrets.PR_WORKFLOW_IAM_ROLE_ARN}}
role-session-name: PullRequestBuildGitHubAction
aws-region: us-west-2
role-duration-seconds: 10800 # 3 hrs
- 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
chmod +x ./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_REF: ${{ github.event.pull_request.head.ref || github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
if [ -z "$PR_NUMBER" ] && [[ "$HEAD_REF" =~ ^gh-readonly-queue/.+/pr-([0-9]+)- ]]; then
PR_NUMBER="${BASH_REMATCH[1]}"
fi
./$DOWNLOAD_FOLDER/$SCRIPT_LOCATION \
--repo "${{ github.repository }}" \
--branch "$HEAD_REF" \
--pr-number "$PR_NUMBER" \
--run-id "${{ github.run_id }}"
timeout-minutes: 120