https://github.com/appleboy/discord-action
GitHub Action that sends a Discord message.
https://github.com/appleboy/discord-action
discord discord-bot github-actions
Last synced: 11 days ago
JSON representation
GitHub Action that sends a Discord message.
- Host: GitHub
- URL: https://github.com/appleboy/discord-action
- Owner: appleboy
- Created: 2019-02-24T01:28:22.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-08T15:26:15.000Z (6 months ago)
- Last Synced: 2024-10-29T10:07:29.133Z (6 months ago)
- Topics: discord, discord-bot, github-actions
- Language: Dockerfile
- Homepage: https://github.com/marketplace/actions/discord-message-notify
- Size: 105 KB
- Stars: 98
- Watchers: 3
- Forks: 11
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-actions - Send a File or Text Message to Discord (custom define color, username or avatar)
- fucking-awesome-actions - Send a File or Text Message to Discord (custom define color, username or avatar)
- awesome-workflows - Send a File or Text Message to Discord (custom define color, username or avatar)
README
# 🚀 Discord for GitHub Actions
English | [繁體中文](./README.zh-tw.md) | [简体中文](./README.zh-cn.md)
[GitHub Action](https://developer.github.com/actions/) for sending a [Discord](https://discordapp.com/) notification message.
[](https://github.com/appleboy/discord-action/actions)

**Important**: Only supports **Linux** [Docker](https://www.docker.com/) containers.
## Features
- [x] Send Multiple Messages
- [x] Send Multiple Files## Usage
Send a custom message as shown below:
```yaml
name: discord message
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: send custom message
uses: appleboy/[email protected]
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}
message: The ${{ github.event_name }} event triggered first step.
```## Input variables
- webhook_url: Webhook URL of the channel.
- webhook_id: Webhook ID of the channel.
- webhook_token: Webhook token of the channel.
- username: (Optional) Override the default username of the webhook.
- avatar_url: (Optional) Override the default avatar of the webhook.
- color: (Optional) Color code of the embed.
- file: (Optional) Send a file message.
- debug: (Optional) Enable debug mode.## Example
Send a custom message using `webhook_url`:
```yaml
- name: send message
uses: appleboy/[email protected]
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}
message: The ${{ github.event_name }} event triggered first step.
```Send the default message:
```yaml
- name: send message
uses: appleboy/[email protected]
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}
```Send the message with a custom color and username:
```yaml
- name: send message
uses: appleboy/[email protected]
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
color: "#48f442"
username: "GitHub Bot"
message: "A new commit has been pushed with custom color."
```Send multiple files:
```yaml
- name: send message
uses: appleboy/[email protected]
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
file: "./images/message.png"
message: "Send Multiple File."
```