File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 AWS_DEFAULT_REGION : us-west-2
1010
1111jobs :
12+ collab-check :
13+ runs-on : ubuntu-latest
14+ outputs :
15+ approval-env : ${{ steps.collab-check.outputs.result }}
16+ steps :
17+ - name : Collaborator Check
18+ uses : actions/github-script@v7
19+ id : collab-check
20+ with :
21+ github-token : ${{ github.token }}
22+ result-encoding : string
23+ script : |
24+ try {
25+ const res = await github.rest.repos.checkCollaborator({
26+ owner: context.repo.owner,
27+ repo: context.repo.repo,
28+ username: "${{ github.event.pull_request.user.login }}",
29+ });
30+ console.log("Verifed ${{ github.event.pull_request.user.login }} is a repo collaborator. Auto Approving PR Checks.")
31+ return res.status == "204" ? "auto-approve" : "manual-approval"
32+ } catch (error) {
33+ console.log("${{ github.event.pull_request.user.login }} is not a collaborator. Requiring Manual Approval to run PR Checks.")
34+ return "manual-approval"
35+ }
36+ wait-for-approval :
37+ runs-on : ubuntu-latest
38+ needs : [collab-check]
39+ environment : ${{ needs.collab-check.outputs.approval-env }}
40+ steps :
41+ - run : echo "Workflow Approved! Starting PR Checks."
42+
1243 test_coverage_python :
1344 runs-on : ubuntu-latest
1445 continue-on-error : false
You can’t perform that action at this time.
0 commit comments