Skip to content

Commit

Permalink
chore: add discord failure hook
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Sep 22, 2024
1 parent cdad55a commit 57d8943
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/discord.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Notify on CI Failure

on:
push:
branches:
- main
workflow_run:
workflows: ["*"]
types:
- completed

jobs:
notify:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
steps:
- name: Send Discord Notification
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{"content": "CI Failure Detected on Main Branch :x:"}' \
$DISCORD_WEBHOOK_URL

0 comments on commit 57d8943

Please sign in to comment.