Skip to content
/ DNGA Public template

Send Discord notifications for GitHub pushes and releases without any dependencies flawlessly.

License

Notifications You must be signed in to change notification settings

Zeno-Fluff/DNGA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DNGA

DNGA - Discord-Notification-Github-Action.

Send clean Discord notifications when you push to main or other branches when you publish a new release.

GitHub Workflow Status

Features

  • Push notifications with commit message and author
  • Release alerts with tag, name, and link
  • Uses GitHub Secrets to keep your webhook safe

Template Setup

  1. press use this template.
  2. add your DISCORD_WEBHOOK secret in your repo settings with your webhook link inside of it.

Setup (if you don't want to use the template)

  1. Create a file named .github/workflows/discord.yml
  2. Paste the following code into it (modify as you wish):
`yaml
name: Discord Notification

on:
  push:
    branches:
      - main   
  release:
    types: [published]  
jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - name: Send Discord message for push
        if: github.event_name == 'push'
        env:
          DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
        run: |
          curl -H "Content-Type: application/json" \
            -X POST \
            -d "{\"content\": \"name here-\nπŸ› οΈ New push to *main* by ${{ github.actor }}\nπŸ”— [View Commit](${{ github.event.head_commit.url }})\nπŸ“ Message: ${{ github.event.head_commit.message }}\"}" \
            $DISCORD_WEBHOOK
      - name: Send Discord message for release
        if: github.event_name == 'release'
        env:
          DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
        run: |
          curl -H "Content-Type: application/json" \
            -X POST \
            -d "{\"content\": \"name here-\nπŸš€ New release published by ${{ github.actor }}\n🏷️ Tag: ${{ github.event.release.tag_name }}\nπŸ“ Name: ${{ github.event.release.name }}\nπŸ”— [View Release](${{ github.event.release.html_url }})\"}" \
            $DISCORD_WEBHOOK
  1. create a webhook on your discord server either on the web or desktop app.
  2. Go to your repo β†’ Settings β†’ Secrets β†’ Actions.
  3. Add a secret named DISCORD_WEBHOOK with your Discord webhook URL.

Example of what it should look like when you're done ( minus my logo and repo ) DNGAdiscordphoto

About

Send Discord notifications for GitHub pushes and releases without any dependencies flawlessly.

Topics

Resources

License

Stars

Watchers

Forks