main
yml 51 lines 2.11 KB
Raw
1 name: (Runtime) Discord Notify
2
3 on:
4 pull_request_target:
5 types: [opened, ready_for_review]
6 paths-ignore:
7 - packages/react-devtools**
8 - compiler/**
9 - .github/workflows/compiler_**.yml
10 - .github/workflows/devtools**.yml
11
12 permissions: {}
13
14 jobs:
15 check_access:
16 if: ${{ github.event.pull_request.draft == false }}
17 runs-on: ubuntu-latest
18 outputs:
19 is_member_or_collaborator: ${{ steps.check_is_member_or_collaborator.outputs.is_member_or_collaborator }}
20 steps:
21 - run: echo ${{ github.event.pull_request.author_association }}
22 - name: Check is member or collaborator
23 id: check_is_member_or_collaborator
24 if: ${{ github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' }}
25 run: echo "is_member_or_collaborator=true" >> "$GITHUB_OUTPUT"
26
27 check_maintainer:
28 if: ${{ needs.check_access.outputs.is_member_or_collaborator == 'true' || needs.check_access.outputs.is_member_or_collaborator == true }}
29 needs: [check_access]
30 uses: react/react/.github/workflows/shared_check_maintainer.yml@main
31 permissions:
32 # Used by check_maintainer
33 contents: read
34 with:
35 actor: ${{ github.event.pull_request.user.login }}
36
37 notify:
38 if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
39 needs: check_maintainer
40 runs-on: ubuntu-latest
41 steps:
42 - name: Discord Webhook Action
43 uses: tsickert/discord-webhook@86dc739f3f165f16dadc5666051c367efa1692f4
44 with:
45 webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
46 embed-author-name: ${{ github.event.pull_request.user.login }}
47 embed-author-url: ${{ github.event.pull_request.user.html_url }}
48 embed-author-icon-url: ${{ github.event.pull_request.user.avatar_url }}
49 embed-title: '#${{ github.event.number }} (+${{github.event.pull_request.additions}} -${{github.event.pull_request.deletions}}): ${{ github.event.pull_request.title }}'
50 embed-description: ${{ github.event.pull_request.body }}
51 embed-url: ${{ github.event.pull_request.html_url }}