Skip to content

Kometa-Team/discord-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discord-notifications

Action that uses a webhook for sending automatic Discord messages on new repository releases.

alt

Example usage

Create file discord-release-msg.yml under folder .github/workflows in your project's root folder:

.github/workflows/discord-release-msg.yml

name: Release messages to discord announcement channel

on:
  release:
    types: [ published ]

jobs:
  run_main:
    runs-on: ubuntu-18.04
    name: Sends custom message
    steps:
      - name: Sending message
        uses: Kometa-Team/discord-notifications@master
        with:
          webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
          webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}

Create a webhook

To create a new webhook in discord go to Channel > Edit > Integrations > Webhooks > New Webhook

Once you have the webhoook URL, you can get the ID and the TOKEN. They are included in the URL like so:

https://discord.com/api/webhooks/ID/TOKEN

Adding necessary secrets

This is needed to not expose your ID/TOKEN (which would mean anybody can use your webhook)

In your github project go to Settings > Secrets > New repository secret

And add these two secrets (New repository secret button):

Name: DISCORD_WEBHOOK_ID Value: ID (from url)

Name: DISCORD_WEBHOOK_TOKEN Value: TOKEN (from url)


Now every new project release will send a POST using the created webhook, posting a new styled message in the channel where the webhook was created.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published