A GitHub Action that sends notifications to messaging platforms when your workflows run.
- Send a notification from any workflow step
- Default message summarizes the run (workflow, repository, status, commit, run link), formatted for each platform
- Supported platforms:
- ✅ Telegram
- ✅ Discord
- Create a Telegram bot using @BotFather and obtain the bot token
- Get your chat ID:
- Add @userinfobot to your chat
- Start the chat, and it will display your chat ID
- Store these as repository secrets:
TELEGRAM_BOT_TOKEN,TELEGRAM_CHAT_ID
- In the Discord channel settings, open Integrations → Webhooks and create a webhook
- Copy the webhook URL and store it as the repository secret
DISCORD_WEBHOOK_URL
steps:
# Your workflow steps here...
- name: Send Notification
uses: tiennm99dev/notify-action@v1
with:
platform: telegram
telegram_bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
telegram_chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
message: "🚀 Deployment completed successfully!"| Input | Description | Required | Default |
|---|---|---|---|
platform |
Messaging platform to use (telegram, discord) |
Yes | telegram |
message |
The message content to send | No | Run summary formatted for the platform |
status |
Workflow status shown in the default message (success, failure, cancelled, or custom text) |
No | success |
telegram_bot_token |
Telegram Bot API token | For Telegram | - |
telegram_chat_id |
Telegram chat ID to send the message to | For Telegram | - |
discord_webhook_url |
Discord channel webhook URL | For Discord | - |
A custom message is sent as-is, so use the markup the platform understands:
- Telegram: HTML (
<b>,<i>,<a href="...">). Escape literal<,>, and&as<,>,&. - Discord: Markdown (
**bold**,*italic*,[text](url)). Messages are limited to 2000 characters.
job.status is success, failure, or cancelled; if: always() makes the step run in every case.
- name: Notify
if: always()
uses: tiennm99dev/notify-action@v1
with:
platform: telegram
status: ${{ job.status }}
telegram_bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
telegram_chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}- name: Notify with Custom Message
uses: tiennm99dev/notify-action@v1
with:
platform: telegram
message: "<b>Release v1.0.0</b> has been <i>deployed</i> to production! 🎉"
telegram_bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
telegram_chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}- name: Notify on Failure
if: failure()
uses: tiennm99dev/notify-action@v1
with:
platform: discord
status: failure
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}Requires Node.js 24 and npm.
git clone https://github.com/tiennm99dev/notify-action.git
cd notify-action
npm ci
npm run lint # ESLint with JSDoc rules
npm test # node:test unit tests
npm run build # bundle into dist/ with nccThe action runs from the bundled dist/index.js, so commit dist/ together with source changes. CI fails when dist/ does not match a fresh build.
Publish a GitHub release with a vX.Y.Z tag. The release workflow moves the matching major tag (for example v1) to that release, which is what uses: tiennm99dev/notify-action@v1 resolves to.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.