Skip to content

Commit

Permalink
fix: discord notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
snorreks committed Jan 16, 2025
1 parent 037f4fb commit 295d957
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 63 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/discord-notifications-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pull Request Notifications

on:
pull_request:
types: [opened, reopened]

jobs:
notify-on-pr:
name: Notify Discord on Pull Request
runs-on: ubuntu-latest
steps:
- name: Notify Discord about New PR
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: '🔔 New Pull Request Created!'
embed-description: |
**Title:** ${{ github.event.pull_request.title }}
**Description:** ${{ github.event.pull_request.body }}
**Branch:** ${{ github.event.pull_request.head.ref }}
**Created by:** ${{ github.actor }}
[View Pull Request](${{ github.event.pull_request.html_url }})
embed-color: 3447003 # Dark blue
42 changes: 42 additions & 0 deletions .github/workflows/discord-notifications-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check Build, Release and Deploy Status

on:
workflow_run:
workflows: ['Build, Release and Deploy'] # Triggered by this workflow
types:
- completed # Trigger when the workflow completes

jobs:
notify-status:
name: Notify Discord on Workflow Status
runs-on: ubuntu-latest

steps:
# Notify on Success
- name: Notify Discord on Success
if: ${{ github.event.workflow_run.conclusion == 'success' }} # Runs only on success
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: '🎉 Build, Release, and Deploy Succeeded!'
embed-description: |
**Version:** ${{ github.event.workflow_run.head_branch }}
**Repository:** ${{ github.repository }}
**Triggered by:** ${{ github.event.workflow_run.actor }}
embed-color: 65280 # Green
embed-footer-text: 'The pipeline completed successfully!'

# Notify on Failure
- name: Notify Discord on Failure
if: ${{ github.event.workflow_run.conclusion == 'failure' }} # Runs only on failure
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: '🚨 Build, Release, and Deploy Failed!'
embed-description: |
**Workflow:** Build, Release, and Deploy
**Repository:** ${{ github.repository }}
**Branch:** ${{ github.event.workflow_run.head_branch }}
**Triggered by:** ${{ github.event.workflow_run.actor }}
embed-color: 15158332 # Red
embed-footer-text: 'The pipeline encountered errors.'
25 changes: 25 additions & 0 deletions .github/workflows/discord-notifications-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Discord Push Notifications

on:
push:
branches:
- '**' # Notify for all branches
paths:
- '**' # Notify only when files are changed

jobs:
notify-on-push:
name: Notify on Push
runs-on: ubuntu-latest
steps:
- name: Notify Discord about Push
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: '🚀 New Commit Pushed!'
embed-description: |
**Commit Message:** ${{ github.event.head_commit.message }}
**Branch:** ${{ github.ref_name }}
**Author:** ${{ github.actor }}
[View Commit](${{ github.event.head_commit.url }})
embed-color: 3066993 # Blue
63 changes: 0 additions & 63 deletions .github/workflows/discord-notifications.yml

This file was deleted.

0 comments on commit 295d957

Please sign in to comment.