Skip to content

Send a message to Discord from your Github Workflow

Notifications You must be signed in to change notification settings

discord-actions/message

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Message ✉️

Simply sends a message to Discord.

Simple usage

name: Notify Discord
uses: discord-actions/message@v2
with:
  webhookUrl: ${{ secrets.DISCORD_WEBHOOK_URL }}
  message: "Hello, from Github"

Specify a username and avatar

name: Notify Discord
uses: discord-actions/message@v2
with:
  webhookUrl: ${{ secrets.DISCORD_WEBHOOK_URL }}
  message: "Hello, from Github"
  username: "Github"
  avatar: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"

On Success

jobs:
  job-name:
    steps:
      - name: Notify Discord
        if: success()
        uses: discord-actions/message@v2
        with:
          webhookUrl: ${{ secrets.DISCORD_WEBHOOK_URL }}
          message: "Hello, from Github"

On Failure

jobs:
  job-name:
    steps:
      - name: Notify Discord
        if: failure()
        uses: discord-actions/message@v2
        with:
          webhookUrl: ${{ secrets.DISCORD_WEBHOOK_URL }}
          message: "Hello, from Github"

On any failed job

jobs:
  job-name:
    steps:
      - name: Notify Discord
        if: ${{ always() && contains(needs.*.result, 'failure') }}
        uses: discord-actions/message@v2
        with:
          webhookUrl: ${{ secrets.DISCORD_WEBHOOK_URL }}
          message: "Hello, from Github"