Skip to content

mitz-it/discord-message-action

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

MitzIT Discord Message Action

An action to send messages and reactions to a Discord text channel.

Usage

name: pull_request

on:
  pull_request:
    types: [ labeled ]

jobs:
  discord:
    runs-on: ubuntu-latest
    steps:
      - name: Send message to Discord
        uses: mitz-it/discord-message-action@v1
        with:
          token: ${{ secrets.DISCORD_BOT_TOKEN }}
          channel-id: ${{ secrets.DISCORD_CHANNEL_ID }}
          message-content: "Hello from GitHub"

Adding Reactions

You can add an emote reaction to your text message

name: pull_request

on:
  pull_request:
    types: [ labeled ]

env:
  EMOTE_NAME: "<:smiley:1234567891011121314>"

jobs:
  discord:
    runs-on: ubuntu-latest
    steps:
      - name: Send message to Discord
        uses: mitz-it/discord-message-action@v1
        with:
          token: ${{ secrets.DISCORD_BOT_TOKEN }}
          channel-id: ${{ secrets.DISCORD_CHANNEL_ID }}
          message-content: "Hello from GitHub"
          emote-name: ${{ env.EMOTE_NAME }}
          emote-animated: false

Or use with custom emojis from your server:

name: pull_request

on:
  pull_request:
    types: [ labeled ]

env:
  EMOTE_ID: "1234567891011121314"
  EMOTE_NAME: custom

jobs:
  discord:
    runs-on: ubuntu-latest
    steps:
      - name: Send message to Discord
        uses: mitz-it/discord-message-action@v1
        with:
          token: ${{ secrets.DISCORD_BOT_TOKEN }}
          channel-id: ${{ secrets.DISCORD_CHANNEL_ID }}
          message-content: "Hello from GitHub"
          emote-id: ${{ env.EMOTE_ID }}
          emote-name: ${{ env.EMOTE_NAME }}
          emote-animated: false