11name : Assign PR reviewers
22on :
3- pull_request_target :
4- types : [opened, synchronize, reopened]
5-
3+ workflow_run :
4+ workflows :
5+ - Compile dependencies.json for PR assignment checks
6+ types :
7+ - completed
68jobs :
79 assign_reviewers :
10+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
811 name : Assign reviewers
912 runs-on : ubuntu-latest
1013
1114 steps :
15+ - name : Checkout
16+ uses : actions/checkout@v6
17+ with :
18+ ref : master
1219 - name : Generate app token
1320 id : token
1421 uses : actions/create-github-app-token@v2
1522 with :
1623 app-id : ${{ vars.PR_BOT_ID }}
1724 private-key : ${{ secrets.PR_BOT_PEM }}
18-
19- - name : Checkout
20- uses : actions/checkout@v6
25+ - name : Download dependencies.json
26+ uses : ./.github/actions/unzip-artifact
2127 with :
22- ref : refs/pull/${{ github.event.pull_request.number }}/head
23-
24- - name : Install dependencies
25- uses : ./.github/actions/npm-ci
26- - name : Build
27- run : |
28- npx gulp build
28+ name : dependencies.json
29+ - name : Download PR info
30+ uses : ./.github/actions/unzip-artifact
31+ with :
32+ name : prInfo
2933 - name : Install s3 client
3034 run : |
3135 npm install @aws-sdk/client-s3
@@ -35,14 +39,17 @@ jobs:
3539 env :
3640 AWS_ACCESS_KEY_ID : ${{ vars.PR_BOT_AWS_AK }}
3741 AWS_SECRET_ACCESS_KEY : ${{ secrets.PR_BOT_AWS_SAK }}
42+ DEPENDENCIES_JSON : ${{ runner.temp }}/artifacts/dependencies.json
3843 with :
3944 github-token : ${{ steps.token.outputs.token }}
4045 script : |
46+ const fs = require('fs');
4147 const getProps = require('./.github/workflows/scripts/getPRProperties.js')
48+ const { prNo } = JSON.parse(fs.readFileSync('${{runner.temp}}/artifacts/prInfo.json').toString());
4249 const props = await getProps({
4350 github,
4451 context,
45- prNo: ${{ github.event.pull_request.number }} ,
52+ prNo,
4653 reviewerTeam: '${{ vars.REVIEWER_TEAM }}',
4754 engTeam: '${{ vars.ENG_TEAM }}',
4855 authReviewTeam: '${{ vars.AUTH_REVIEWER_TEAM }}'
0 commit comments