forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (28 loc) · 1.09 KB
/
Copy pathdiscord_pr_announce.yml
File metadata and controls
29 lines (28 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: "Discord PR Notification"
on:
pull_request_target:
types: [opened, closed, reopened]
jobs:
notify:
runs-on: ubuntu-24.04
steps:
- name: "Check for DISCORD_WEBHOOK"
id: secrets_set
env:
ENABLER_SECRET: ${{ secrets.DISCORD_WEBHOOK }}
run: |
unset SECRET_EXISTS
if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi
echo "SECRETS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT
- name: Send Discord notification
uses: tgstation/discord-notify@main
if: >
steps.secrets_set.outputs.SECRETS_ENABLED &&
(github.event.pull_request.merged == true || github.event.action == 'opened' || github.event.action == 'reopened') &&
github.event.pull_request.author_association != 'FIRST_TIMER' &&
github.event.pull_request.author_association != 'FIRST_TIME_CONTRIBUTOR'
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
include_image: false
show_author: false
avatar_url: https://avatars.githubusercontent.com/u/1363778?s=200&v=4