Skip to content

Commit 57d8943

Browse files
committed
chore: add discord failure hook
1 parent cdad55a commit 57d8943

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/discord.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Notify on CI Failure
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_run:
8+
workflows: ["*"]
9+
types:
10+
- completed
11+
12+
jobs:
13+
notify:
14+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Send Discord Notification
18+
env:
19+
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
20+
run: |
21+
curl -H "Content-Type: application/json" \
22+
-X POST \
23+
-d '{"content": "CI Failure Detected on Main Branch :x:"}' \
24+
$DISCORD_WEBHOOK_URL

0 commit comments

Comments
 (0)