Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
send

GitHub Action

Actions Status Discord

v1.7.1

Actions Status Discord

send

Actions Status Discord

Post Github Actions CI status to Discord

Installation

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

              

- name: Actions Status Discord

uses: sarisia/[email protected]

Learn more about this action in sarisia/actions-status-discord

Choose a version

Actions Status Discord

A Github Actions action to notify CI status to Discord.

Usage

Minimum

- uses: sarisia/actions-status-discord@v1
  if: always()
  with:
    webhook: ${{ secrets.DISCORD_WEBHOOK }}

Screen Shot 2020-05-14 at 11 42 20

Full options

- uses: sarisia/actions-status-discord@v1
  if: always()
  with:
    webhook: ${{ secrets.DISCORD_WEBHOOK }}
    status: ${{ job.status }}
    title: "deploy"
    description: "Build and deploy to GitHub Pages"
    nofail: false
    nocontext: false
    noprefix: false
    color: 0x0000ff
    username: GitHub Actions
    avatar_url: ${{ secrets.AVATAR_URL }}

Screen Shot 2020-05-14 at 11 42 53

No detail

- uses: sarisia/actions-status-discord@v1
  if: always()
  env:
    DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
  with:
    nodetail: true
    title: "We did it!"
    color: 0xff91a4

Screen Shot 2020-05-14 at 11 43 28

For if parameter, see GitHub Actions Reference

Environment Variables

Key Value Description
DISCORD_WEBHOOK Discord webhook endpoind like:
https://discordapp.com/api/webhooks/...
You can provide webhook via inputs either.
DO NOT APPEND /github SUFFIX!

Inputs

Key Required Value Default Description
webhook No String env.DISCORD_WEBHOOK Discord webhook endpoind like:
https://discordapp.com/api/webhooks/...
This overrides env.DISCORD_WEBHOOK.
DO NOT APPEND /github SUFFIX!
status No Success, Failure or Cancelled ${{ job.status }} See Document for job context
title No String ${{ github.workflow}} String included in embed title. Overrides job input.
description No String Description included in message
color No Hex string like: 0xFFFFFF Overrides Discord embed color
username No String Overrides Discord webhook username
avatar_url No String Overrides Discord webhook avatar url
nofail No true or false true This action won't make workflow failed by default. If set to false, this action will set status failed when failed to notify.
nocontext No true or false false Set true to suppress GitHub context fields (Repository, Ref, etc).
noprefix No true or false false Set true to avoid appending job status (Success: , etc.) to title
nodetail No true or false false Set true will set both nocontext and noprefix to true

Deprecated inputs

Key Required Value Default Description
job No String Deprecated. Will be removed in v2
Job name included in message title. Same as title input.

Tips

Using markdown

Some fields support markdown syntax.

- uses: sarisia/actions-status-discord@v1
  with:
    webhook: ${{ secrets.DISCORD_WEBHOOK }}
    nodetail: true
    title: New version of `software` is ready!
    description: |
      Version `1.2.3-alpha`
      Click [here](https://github.com/sarisia/actions-status-discord) to download!

Screen Shot 2020-10-02 at 17 55 02

Trigger multiple webhooks

You can set multiple webhooks separated with EOL (line break, \n) to Secrets.

For example, set Secrets to:

https://discordapp.com/api/webhooks/...
https://media.guilded.gg/weabhooks/...
https://this-is-invalid-webhook-endpoint.invalid/...

will trigger these 3 webhooks simultaneously.

If some of these webhooks are failed, other deliveries will NOT be cancelled.

If the option nofail is set to false and any of one fail, the action will set workflow status to Failure.

Guilded webhook support

As Guilded supports Discord Webhooks API, you can use Guilded webhook endpoint in the same way as Discord webhook.

Guilded Embed Image Screen Shot 2020-05-14 at 11 44 21

Troubleshooting

Error: Webhook response: 400: {"sender":["This field is required"]}

Do not append /github suffix to your webhook URL. See Inputs section.