Sends a Discord notification message. Simple as that. Supports all workflow event types by using the Discord GitHub webhooks.
Appearance on Discord :
This GitHub action is part of a list of Actions that are located in an other repo. Feel free to check it out : https://github.com/Ilshidur/actions.
As this Action is containerized with Docker, it can only run on Linux environments.
Docker container actions can only execute in the GitHub-hosted Linux environment. Self-hosted runners must use a Linux operating system and have Docker installed to run Docker container actions. For more information about the requirements of self-hosted runners, see "About self-hosted runners."
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: 'The project {{ EVENT_PAYLOAD.repository.full_name }} has been deployed.'NOTICE : for stability purposes, it is recommended to use the action with an explicit commit SHA-1 :
- Version :
uses: "Ilshidur/[email protected]"(β link to the releases list : https://github.com/Ilshidur/action-discord/releases) - Commit SHA-1 :
uses: "Ilshidur/action-discord@ad5235de713df3ef38022185499b02ffe93b7efe"(β link to the commits list : https://github.com/Ilshidur/action-discord/commits/master)
By default, the GitHub action will send a notificaction with the event informations. Providing the arguments will override the message.
Environment variables can be interpolated in the message using brackets ({{ and }}) :
e.g.: Action called : {{ GITHUB_ACTION }}
Event Payload data can also be interpolated in the message using brackets ({{ and }}) with the EVENT_PAYLOAD variable.
e.g.: Action called: {{ GITHUB_ACTION }} as {{ EVENT_PAYLOAD.pull_request.id }}
See the event types for valid payload informations.
args = "Hello, beautiful ! I ran a GitHub Actions for you <3"args = "I showed you my commit. Please respond."
DISCORD_WEBHOOK(required): the Discord webhook URL (see https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks).- IMPORTANT !! You MUST NOT append
/githubat the end of the webhook.
- IMPORTANT !! You MUST NOT append
DISCORD_USERNAME(optional): overrides the bot nickname.DISCORD_AVATAR(optional): overrides the avatar URL.DISCORD_MENTIONS(optional): A valid JSON string of a Discordallowed_mentionsobject. See the Discord Allowed Mentions documentation.DISCORD_EMBEDS(optional): A valid JSON string of an array of Discordembedobjects. See the Discord WebHook Embeds documentation.
Note: For
DISCORD_MENTIONSandDISCORD_EMBEDS, you can use${{ toJson(my_value) }}with thetoJson()function if your input is an object value.
- That's all.
Because open source is about everyone :
https://github.com/marketplace/actions/discord-message-notify
- Pass arguments with the
withkeyword - Run outside of a container.
Don't forget to π Star π the repo if you like this GitHub Action !
Your feedback is appreciated