https://github.com/netail/webhook-notifier
GitHub Action to send a message to a single or multiple webhooks at once
https://github.com/netail/webhook-notifier
discord github-actions node notifier slack teams webhook
Last synced: 3 months ago
JSON representation
GitHub Action to send a message to a single or multiple webhooks at once
- Host: GitHub
- URL: https://github.com/netail/webhook-notifier
- Owner: Netail
- License: mit
- Created: 2021-07-10T01:12:21.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-30T20:23:48.000Z (about 1 year ago)
- Last Synced: 2025-05-13T13:18:05.209Z (about 1 year ago)
- Topics: discord, github-actions, node, notifier, slack, teams, webhook
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/webhook-notifier
- Size: 531 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Webhook Notifier
A GitHub Action to concurrently send the same message to multiple different webhooks.
Currently supports the following platforms:
- Discord
- Slack
- Microsoft Teams
## Getting Started
Create a new GitHub Actions workflow (e.g. `.github/workflows/notifier.yml`)
### Example workflow
An example of the GitHub Actions workflow
```yml
name: 'Pull Request Notifier'
on:
pull_request:
types: [opened]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: Netail/webhook-notifier@v1
with:
discord-url: 'https://discord.com/api/webhooks/...'
slack-url: 'https://hooks.slack.com/services/..., https://hooks.slack.com/services/...'
teams-url: '["https://outlook.office.com/webhook/...", "https://outlook.office.com/webhook/..."]'
color: 'info'
title: '${{ github.event.pull_request.user.login }} opened PR-${{ github.event.number }} in ${{ github.event.repository.name }}'
text: ${{ github.event.pull_request.title }}
fields: '[{"name": "Repository", "value": "${{ github.event.repository.name }}"}, {"name": "Pull Request ID", "value": "${{ github.event.number }}"}]'
buttons: '[{"label": "View PR", "url": "${{ github.event.pull_request.html_url }}"}]'
```
## Inputs
The action has any of the follow inputs
| Name | Description | Default | Notes |
| - | - | - | - |
| `dry-run` | Prevent sending the payload | false | |
| `discord-url` | Discord Webhook URL(s) | N/A | Optional: Can be comma separated values, or stringified JSON array of strings. |
| `slack-url` | Slack Webhook URL(s) | N/A | Optional: Can be comma separated values, or stringified JSON array of strings. |
| `teams-url` | Teams Webhook URL(s) | N/A | Optional: Can be comma separated values, or stringified JSON array of strings. |
| `color` | Color of the message | `success` | Value can be in hexadecimal or the title of a predefined color |
| `title` | Text at the top of the message | `Hello world!` | |
| `text` | Text to be displayed under the title | N/A | |
| `fields` | Extra info to be displayed under the message | N/A | Stringified JSON array of objects with the attributes `name` and `value` ( e.g. `'[{"name": "string", "value": "string"}]'`) |
| `buttons` | Additional buttons under the message | N/A | Stringified JSON array of objects with the attributes `label` and `url` ( e.g. `'[{"label": "string", "url": "string"}]'`) Discord does not support buttons in incoming webhooks (yet) |
### Predefined colors
Name
Hexadecimal
success
#28A745
opened
failure
#CB2431
closed
merged
#6F42C1
info
#0366D5
warning
#FFC107
cancelled
#959DA5