Giter Club home page Giter Club logo

actions-status-discord's Introduction

Actions Status Discord

Post GitHub Actions status to Discord as an beautiful embed

image

  • ๐Ÿฃ Zero-configuration! Works perfectly out of the box.
  • ๐Ÿฃ Universal! Supports Linux (Ubuntu), macOS and Windows runners.
  • ๐Ÿฃ Fast startup! Faster than ones written as Docker container action.

โš ๏ธ If you're reading this document in master branch, please refer to the latest released document here.

Usage

Minimum

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

image

Full options

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

image

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

image

For if parameter, see GitHub Actions Reference

Configuration

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

General customizations

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
image No String Image attached to the message
color No Hex string like: 0xFFFFFF Overrides Discord embed color
url No String URL to jump when the title is clicked
username No String Overrides Discord webhook username
avatar_url No String Overrides Discord webhook avatar url

Advanced usages

Key Required Value Default Description
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
notimestamp No true or false false Set true to avoid appending timestamp
Show deprecated
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!

image

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/webhooks/...
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.

FAQ

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

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

Questions? Bugs?

Feel free to ask in Discussions, or report bugs in Issues!

actions-status-discord's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar kisaragieffective avatar meisnate12 avatar sarisia avatar weslleynasrocha avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.