File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Build SDK
22on :
33 merge_group :
4- pull_request :
4+ pull_request_target :
5+ types : [opened, synchronize, reopened, labeled]
56 push :
67 branches :
78 - master
1112 - ' docs/**'
1213
1314concurrency :
14- group : start-pull-request-build-${{ github.ref }}
15+ group : start-pull-request-build-${{ github.event.pull_request.number || github. ref }}
1516 cancel-in-progress : true
1617
1718env :
1819 DOWNLOAD_FOLDER : ' .build-scripts/'
1920 SCRIPT_LOCATION : ' workflows/start-pull-request-build/pull-request-build-v1.sh'
2021
2122jobs :
23+ # Strip the safe-to-build label on every new push from a fork so that
24+ # a maintainer must re-review and re-label after each update.
25+ revoke-approval :
26+ if : >
27+ github.event_name == 'pull_request_target' &&
28+ github.event.action == 'synchronize' &&
29+ github.event.pull_request.head.repo.full_name != github.repository
30+ runs-on : ubuntu-latest
31+ permissions :
32+ pull-requests : write
33+ steps :
34+ - name : Remove safe-to-build label
35+ env :
36+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37+ run : |
38+ gh api -X DELETE \
39+ "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/safe-to-build" \
40+ || true # 404 if label wasn't present
41+
2242 aws-sdk-pr-build :
23- if : github.event.pull_request.draft == false
43+ needs : revoke-approval
44+ if : >
45+ always() &&
46+ needs.revoke-approval.result != 'failure' &&
47+ (
48+ github.event_name != 'pull_request_target' ||
49+ (
50+ github.event.pull_request.draft == false &&
51+ (
52+ github.event.pull_request.head.repo.full_name == github.repository ||
53+ contains(github.event.pull_request.labels.*.name, 'safe-to-build')
54+ )
55+ )
56+ )
2457 runs-on : ubuntu-latest
2558 permissions :
2659 id-token : write
4982 --branch "$HEAD_REF" \
5083 --pr-number "${{ github.event.pull_request.number }}" \
5184 --run-id "${{ github.run_id }}"
52- timeout-minutes : 120
85+ timeout-minutes : 120
You can’t perform that action at this time.
0 commit comments