Skip to content

This GitHub Action can produce fancy and more meaningful discord messages for your commits.

License

Notifications You must be signed in to change notification settings

mrrobotdotapp/classic-discord-webhook

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Repository files navigation

Twitter Follow Follow @mrrobot on DEV

Classic Discord Webhook Classic Discord Webhook

Github Sponsors

Screenshots

The standard webhook from GitHub to Discord just dumps the commit messages right into your chat, this is fine but sometimes you just want some extra information. Did the commit introduce any new issues? Did it even compile successfully? That's what this Action is for.

Standard Webhook New and improved Webhook
Old webhook interface New webhook interface

Setup

Setup this code on your repository's .github/workflows/ in a file like discord-push.yml and push the changes:

name: Discord Webhook
on: [push]
jobs:
  Discord_notification:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
      - name: Run Discord Webhook
        uses: mrrobotdotapp/classic-discord-webhook@main
        with:
          id: ${{ secrets.DISCORD_WEBHOOK_ID }}
          token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
          #threadId: ${{ secrets.DISCORD_WEBHOOK_THREAD_ID }} # Optional

You can see the example file at /.github/workflows/discord-push.yml

Inputs

in your Settings > Security > Secrets and variables > Actions > Secrets (/settings/secrets/actions) on GitHub, you need to add 2 secrets :

  • DISCORD_WEBHOOK_ID
  • DISCORD_WEBHOOK_TOKEN
DISCORD_WEBHOOK_ID DISCORD_WEBHOOK_TOKEN DISCORD_WEBHOOK_THREAD_ID
Required — This is the id of your Discord webhook, if you copy the webhook url, this will be the first part of it. Required — Your Discord webhook token, it's the second part of the url. Not required — if you want to send the message in a thread, you can specify the thread id here.

Note

Need more help ? See this post on DEV.

follow your repository from Discord - Post on DEV

Donate

Feel free to help the maintenance of this project ! Thanks to all Sponsors on GitHub !

GitHub Sponsors Support me on Buy Me a Coffee

Update the Action

To update the Action, we need to compile with ncc and push the changes to the repository.

npm install -g @vercel/ncc
ncc build src/index.js -o dist -m

Notable documentations