From f2cccca4a1b155cc90e97b6bd2f325ef668d8d1b Mon Sep 17 00:00:00 2001 From: Rishi Bhardwaj Date: Sat, 20 Jun 2026 21:23:01 +0530 Subject: [PATCH] Create discord-notifications.yml --- .github/workflows/discord-notifications.yml | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/discord-notifications.yml diff --git a/.github/workflows/discord-notifications.yml b/.github/workflows/discord-notifications.yml new file mode 100644 index 0000000..69500f1 --- /dev/null +++ b/.github/workflows/discord-notifications.yml @@ -0,0 +1,33 @@ +name: Discord Notifications + +on: + issues: + types: [opened, closed, reopened] + + pull_request: + types: [opened, closed, reopened] + + release: + types: [published] + +jobs: + notify: + runs-on: ubuntu-latest + + steps: + - name: Send Discord Message + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + run: | + if [ "${{ github.event_name }}" = "issues" ]; then + MESSAGE="🐛 Issue: ${{ github.event.issue.title }} - ${{ github.event.issue.html_url }}" + elif [ "${{ github.event_name }}" = "pull_request" ]; then + MESSAGE="🔀 Pull Request: ${{ github.event.pull_request.title }} - ${{ github.event.pull_request.html_url }}" + elif [ "${{ github.event_name }}" = "release" ]; then + MESSAGE="🚀 Release: ${{ github.event.release.name }} - ${{ github.event.release.html_url }}" + fi + + curl -H "Content-Type: application/json" \ + -X POST \ + -d "{\"content\":\"$MESSAGE\"}" \ + "$DISCORD_WEBHOOK"