Skip to content

Commit 295d957

Browse files
committed
fix: discord notifications
1 parent 037f4fb commit 295d957

File tree

4 files changed

+90
-63
lines changed

4 files changed

+90
-63
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Pull Request Notifications
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
notify-on-pr:
9+
name: Notify Discord on Pull Request
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Notify Discord about New PR
13+
uses: tsickert/discord-webhook@v6.0.0
14+
with:
15+
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
16+
embed-title: '🔔 New Pull Request Created!'
17+
embed-description: |
18+
**Title:** ${{ github.event.pull_request.title }}
19+
**Description:** ${{ github.event.pull_request.body }}
20+
**Branch:** ${{ github.event.pull_request.head.ref }}
21+
**Created by:** ${{ github.actor }}
22+
[View Pull Request](${{ github.event.pull_request.html_url }})
23+
embed-color: 3447003 # Dark blue
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Check Build, Release and Deploy Status
2+
3+
on:
4+
workflow_run:
5+
workflows: ['Build, Release and Deploy'] # Triggered by this workflow
6+
types:
7+
- completed # Trigger when the workflow completes
8+
9+
jobs:
10+
notify-status:
11+
name: Notify Discord on Workflow Status
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
# Notify on Success
16+
- name: Notify Discord on Success
17+
if: ${{ github.event.workflow_run.conclusion == 'success' }} # Runs only on success
18+
uses: tsickert/discord-webhook@v6.0.0
19+
with:
20+
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
21+
embed-title: '🎉 Build, Release, and Deploy Succeeded!'
22+
embed-description: |
23+
**Version:** ${{ github.event.workflow_run.head_branch }}
24+
**Repository:** ${{ github.repository }}
25+
**Triggered by:** ${{ github.event.workflow_run.actor }}
26+
embed-color: 65280 # Green
27+
embed-footer-text: 'The pipeline completed successfully!'
28+
29+
# Notify on Failure
30+
- name: Notify Discord on Failure
31+
if: ${{ github.event.workflow_run.conclusion == 'failure' }} # Runs only on failure
32+
uses: tsickert/discord-webhook@v6.0.0
33+
with:
34+
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
35+
embed-title: '🚨 Build, Release, and Deploy Failed!'
36+
embed-description: |
37+
**Workflow:** Build, Release, and Deploy
38+
**Repository:** ${{ github.repository }}
39+
**Branch:** ${{ github.event.workflow_run.head_branch }}
40+
**Triggered by:** ${{ github.event.workflow_run.actor }}
41+
embed-color: 15158332 # Red
42+
embed-footer-text: 'The pipeline encountered errors.'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Discord Push Notifications
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Notify for all branches
7+
paths:
8+
- '**' # Notify only when files are changed
9+
10+
jobs:
11+
notify-on-push:
12+
name: Notify on Push
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Notify Discord about Push
16+
uses: tsickert/discord-webhook@v6.0.0
17+
with:
18+
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
19+
embed-title: '🚀 New Commit Pushed!'
20+
embed-description: |
21+
**Commit Message:** ${{ github.event.head_commit.message }}
22+
**Branch:** ${{ github.ref_name }}
23+
**Author:** ${{ github.actor }}
24+
[View Commit](${{ github.event.head_commit.url }})
25+
embed-color: 3066993 # Blue

.github/workflows/discord-notifications.yml

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

0 commit comments

Comments
 (0)