Skip to content

Commit 447131a

Browse files
committed
[ci] Better filtering for discord notifications
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 5b51a2b commit 447131a

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)