Skip to content
message-circle

GitHub Action

Discord Webhook Messages

v1.1.0 Latest version

Discord Webhook Messages

message-circle

Discord Webhook Messages

GitHub action for posting messages on discord server

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Discord Webhook Messages

uses: bythope/discord-webhook-messages@v1.1.0

Learn more about this action in bythope/discord-webhook-messages

Choose a version

GitHub GitHub tag Discord

The goal of this action is to produce helpful messages on your Discord server based on GitHub events.

Supported events:

  • Release
  • Pull Request
  • Push (branches / tags)
  • Page build

Getting Started:

Inputs


webhookUrl

The webhook URL to use. This should be in a repository secret and the secret should be included here using ${{ secrets.DISCORD_WEBHOOK }}. For security reasons it is not possible to default this to the secret name, so it must be supplied in every action invocation.

handler

Handler defines background logic of the action. Currently avaiable handlers:

  • release: Publishes message to your discord server when release is created.
  • push: Publishes message to your discord server when push action occurs.

Example

Release Handler

name: Discord Webhook Messages
on:
  release:
    types: [published]
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run Discord Webhook
        uses: bythope/discord-webhook-messages@v1.1.0
        with:
          webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
          handler: 'release'

Push Handler

name: Discord Webhook Messages
on:
  push:
    branches: 
      - '*'
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run Discord Webhook
        uses: bythope/discord-webhook-messages@v1.1.0
        with:
          webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
          handler: 'push'

Contributing

Resolve an issue

  1. Read CONTRIBUTING guide
  2. Make the changes
  3. Read Pull request guide

Create feature request

  1. Create issue for an idea
  2. Explain your needs