Skip to content

Commit e5fdd99

Browse files
authored
[ci] Better filtering for discord notifications (facebook#32092)
We don't always consistently use "tags" in commit messages, so let's use the filepaths modified in the PR instead to determine which channel to send notifications to.
1 parent 4749dcb commit e5fdd99

File tree

3 files changed

+48
-35
lines changed

3 files changed

+48
-35
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: (Compiler) Discord Notify
2+
3+
on:
4+
pull_request_target:
5+
types: [labeled]
6+
paths:
7+
- compiler/**
8+
- .github/workflows/compiler_**.yml
9+
10+
jobs:
11+
notify:
12+
if: ${{ github.event.label.name == 'React Core Team' }}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Discord Webhook Action
16+
uses: tsickert/[email protected]
17+
with:
18+
webhook-url: ${{ secrets.COMPILER_DISCORD_WEBHOOK_URL }}
19+
embed-author-name: ${{ github.event.pull_request.user.login }}
20+
embed-author-url: ${{ github.event.pull_request.user.html_url }}
21+
embed-author-icon-url: ${{ github.event.pull_request.user.avatar_url }}
22+
embed-title: '#${{ github.event.number }} (+${{github.event.pull_request.additions}} -${{github.event.pull_request.deletions}}): ${{ github.event.pull_request.title }}'
23+
embed-description: ${{ github.event.pull_request.body }}
24+
embed-url: ${{ github.event.pull_request.html_url }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: (Runtime) Discord Notify
2+
3+
on:
4+
pull_request_target:
5+
types: [labeled]
6+
paths-ignore:
7+
- compiler/**
8+
- .github/workflows/compiler_**.yml
9+
10+
jobs:
11+
notify:
12+
if: ${{ github.event.label.name == 'React Core Team' }}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Discord Webhook Action
16+
uses: tsickert/[email protected]
17+
with:
18+
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
19+
embed-author-name: ${{ github.event.pull_request.user.login }}
20+
embed-author-url: ${{ github.event.pull_request.user.html_url }}
21+
embed-author-icon-url: ${{ github.event.pull_request.user.avatar_url }}
22+
embed-title: '#${{ github.event.number }} (+${{github.event.pull_request.additions}} -${{github.event.pull_request.deletions}}): ${{ github.event.pull_request.title }}'
23+
embed-description: ${{ github.event.pull_request.body }}
24+
embed-url: ${{ github.event.pull_request.html_url }}

.github/workflows/shared_discord_notify.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)