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