1919 pull-requests : write
2020 runs-on : ubuntu-latest
2121 steps :
22- - uses : actions/github-script@v8
22+ - name : Apply internal/external label
23+ id : label_step
24+ uses : actions/github-script@v8
2325 with :
2426 github-token : ${{secrets.GITHUB_TOKEN}}
2527 script : |
@@ -29,19 +31,30 @@ jobs:
2931 'Vandita2020', 'roger-zhangg',
3032 'vicheey', 'bnusunny', 'tobixlea',
3133 'reedham-aws', 'licjun', 'dependabot[bot]'
32- ]
34+ ];
3335 if (maintainers.includes(context.payload.sender.login)) {
34- github.rest.issues.addLabels({
36+ await github.rest.issues.addLabels({
3537 issue_number: context.issue.number,
3638 owner: context.repo.owner,
3739 repo: context.repo.repo,
3840 labels: ['pr/internal']
39- })
41+ });
42+ core.setOutput("external", "false");
4043 } else {
41- github.rest.issues.addLabels({
44+ await github.rest.issues.addLabels({
4245 issue_number: context.issue.number,
4346 owner: context.repo.owner,
4447 repo: context.repo.repo,
4548 labels: ['pr/external', 'stage/needs-triage']
46- })
49+ });
50+ core.setOutput("external", "true");
4751 }
52+ - name : Send Slack Notification for External PR
53+ if : steps.label_step.outputs.external == 'true'
54+ uses : rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2
55+ env :
56+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK_URL }}
57+ SLACK_TITLE : ' PR Created: ${{ github.event.pull_request.title }} by ${{ github.event.pull_request.user.login }}'
58+ SLACK_FOOTER : ' '
59+ MSG_MINIMAL : true
60+ SLACK_MESSAGE : ' ${{ github.event.pull_request.html_url }}'
0 commit comments