Sends a Discord notification message. Simple as that. Supports all workflow event types by using the Discord GitHub webhooks.
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: step-security/action-discord@v0
with:
args: "The project {{ EVENT_PAYLOAD.repository.full_name }} has been deployed."
By default, the GitHub action will send a notification with the event information. 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 information.
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
/github
at 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_EMBEDS
(optional): This should be a valid JSON string of an array of Discordembed
objects. See the documentation on Discord WebHook Embeds for more information. You can use set it to${{ toJson(my_value) }}
usingtoJson()
if your input is an object value.- That's all.