The easiest way to send GitHub repository notifications to Telegram!
Reusable GitHub Actions workflows that make it incredibly simple to get notified about Pull Requests, CI/CD status, releases, and other repository events. Just a few lines of code - no complex configuration needed!
GitHub Notify is a reusable GitHub Action that allows you to send notifications to Telegram when specific events occur in your repository. This action can be integrated into your GitHub Actions workflows to notify you about Pull Requests, CI/CD pipeline status, releases, and other repository events.
GitHub Notify provides reusable workflows that make it incredibly easy to send notifications to Telegram. Simply call our pre-built workflows with just a few lines of code - no need to write complex message templates or configure multiple steps.
The system uses the Telegram Bot API to send messages to your Telegram chat, group, or channel. When configured in your GitHub Actions workflow, it will automatically send beautifully formatted notifications whenever the workflow is triggered (e.g., on push, pull request, release, etc.).
How Reusable Workflows Work:
- You create a simple workflow file in your repository
- You call our reusable workflow with your chat ID and bot token
- Our workflow handles all the formatting and message creation automatically
- You receive a beautifully formatted notification in Telegram
Coming Soon Features:
- More pre-built reusable workflows for different event types (push, release, CI/CD, issues, etc.)
- Support for multiple notification channels (Slack, Discord, Email, etc.)
- Rich message formatting with attachments and media
- Customizable message templates for different event types
- Webhook support for real-time notifications
- Notification filtering and routing based on event types
- Integration with GitHub's native notification system
- Support for scheduled notifications and digest summaries
Before using this action, you need to:
- Create a Telegram bot and obtain a bot token
- Get the chat ID where you want to receive notifications
- Configure GitHub secrets for secure token storage
To create a Telegram bot, you need to interact with BotFather, Telegram's official bot for creating and managing bots.
- Open Telegram and search for
@BotFatherin the search bar - Start a conversation with BotFather by clicking "Start" or sending
/start - Create a new bot by sending the command
/newbot - Choose a name for your bot (e.g., "My GitHub Notifier")
- Choose a username for your bot (must end with
bot, e.g.,my_github_notifier_bot) - Copy the bot token that BotFather provides you. It will look something like:
123456789:ABCdefGHIjklMNOpqrsTUVwxyzβ οΈ Important: Keep this token secure and never commit it to your repository!
Your bot needs permission to send messages. If you're sending to a:
- Private chat: The bot can send messages directly to you
- Group: Add the bot to the group and make sure it has permission to send messages
- Channel: Add the bot as an administrator with permission to post messages
The chat ID identifies where the bot should send messages. The method to get the chat ID depends on whether you're using a private chat, group, or channel.
- Start a conversation with your bot by searching for it in Telegram and clicking "Start"
- Send any message to your bot (e.g., "Hello")
- Visit this URL in your browser (replace
YOUR_BOT_TOKENwith your actual bot token):https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates - Look for the
chatobject in the JSON response. Theidfield is your chat ID:{ "ok": true, "result": [{ "message": { "chat": { "id": 123456789, "first_name": "Your Name", "type": "private" } } }] } - Copy the chat ID (in this example:
123456789)
- Add your bot to the group (search for your bot and add it)
- Send a message in the group (any message will do)
- Visit the same URL as above:
https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates - Find the group chat ID in the response. Group IDs are negative numbers (e.g.,
-1001234567890)
-
Create or select a channel in Telegram
-
Add your bot as an administrator:
- Go to channel settings
- Click "Administrators"
- Click "Add Administrator"
- Select your bot
- Make sure "Post Messages" permission is enabled
-
Post a message in the channel
-
Get the channel ID using one of these methods:
Option A: Using the API
- Visit:
https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates - Look for the channel ID (it will be negative, e.g.,
-1001234567890)
Option B: Using a Telegram Bot
- Forward a message from your channel to
@userinfobotor@getidsbot - The bot will reply with the channel ID
Option C: Using the Channel Username
- If your channel is public, you can use the channel username (e.g.,
@my_channel) - For private channels, you must use the numeric ID
- Visit:
To verify everything is set up correctly, you can test sending a message using curl:
curl -X POST "https://api.telegram.org/botYOUR_BOT_TOKEN/sendMessage" \
-d "chat_id=YOUR_CHAT_ID" \
-d "text=Test message from GitHub Notify"If successful, you should receive the message in your Telegram chat.
To securely store your bot token and chat ID, you need to add them as GitHub Secrets in your repository.
-
Go to your GitHub repository on GitHub.com
-
Click on "Settings" (in the repository navigation bar)
-
Click on "Secrets and variables" β "Actions" (in the left sidebar)
-
Click "New repository secret"
-
Add the following secrets:
Secret 1:
TELEGRAM_BOT_TOKEN- Name:
TELEGRAM_BOT_TOKEN - Value: Your bot token from BotFather (e.g.,
123456789:ABCdefGHIjklMNOpqrsTUVwxyz) - Click "Add secret"
Secret 2:
TELEGRAM_CHAT_ID- Name:
TELEGRAM_CHAT_ID - Value: Your chat ID (e.g.,
123456789or-1001234567890) - Click "Add secret"
- Name:
If you want to use the same secrets across multiple repositories in an organization:
- Go to your organization on GitHub.com
- Click on "Settings"
- Click on "Secrets and variables" β "Actions"
- Click "New organization secret"
- Add the secrets as described above
- Configure repository access to specify which repositories can use these secrets
Now that you have your bot token and chat ID configured, you can use GitHub Notify in your workflows.
π― We highly recommend using our pre-built reusable workflows - they're the easiest and fastest way to get started! Just a few lines of code and you're done. No need to write complex message templates or worry about formatting.
This is the easiest and fastest way to get started! Simply create a workflow file and call our reusable workflow - no need to write complex message templates or configure multiple steps.
Create a workflow file in your repository at .github/workflows/notify-pr.yml:
name: Notify PR via Telegram
on:
pull_request_target:
types:
- opened
jobs:
notify:
uses: jobmetric/github-notify/.github/workflows/telegram-open-pull-request-notify.yml@master
secrets:
bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}That's it! π This workflow will automatically send beautifully formatted notifications to your Telegram whenever:
- A pull request is opened
The notification includes:
- PR title and author
- Repository and PR number
- PR description (body)
- Creation time
- Direct link to the pull request
-
Create a workflow file in your repository:
- Go to your repository on GitHub
- Click on the
.githubfolder (create it if it doesn't exist) - Click on the
workflowsfolder (create it if it doesn't exist) - Click "Add file" β "Create new file"
- Name it something like
notify-pr.yml
-
Copy and paste the workflow code (like the example above)
-
Make sure your secrets are configured (from Step 3 above)
-
Commit the file - GitHub Actions will automatically detect and run it
Important Notes:
- Use the version tag (e.g.,
@master) for the latest version - Both
bot_tokenandchat_idmust be passed as secrets (never hardcode them!) - The workflow uses
pull_request_targetevent type to ensure it has access to the repository secrets - Currently supports
openedevent type for pull requests
We're working on more pre-built workflows for:
- Push notifications
- Release notifications
- CI/CD status notifications
- Issue notifications
- And more!
- Verify bot token: Make sure the token is correct and hasn't been revoked
- Check chat ID: Ensure the chat ID is correct (positive for users, negative for groups/channels)
- Bot permissions: For groups/channels, ensure the bot has permission to send messages
- Start the bot: For private chats, make sure you've started a conversation with the bot
- Your bot token is incorrect or has been revoked
- Regenerate the token from BotFather and update your GitHub secret
- Check that your chat ID is correct
- Verify the message format matches the parse mode you're using
- Ensure special characters are properly escaped (especially for MarkdownV2)
- Make sure the bot is added as an administrator to the channel
- Verify the bot has "Post Messages" permission enabled
- Check that you're using the correct channel ID (not the username for private channels)
- Never commit secrets: Always use GitHub Secrets, never hardcode tokens in workflow files
- Use organization secrets: For multiple repositories, use organization-level secrets
- Rotate tokens regularly: Periodically regenerate your bot token for security
- Limit bot permissions: Only grant the minimum permissions necessary
- Review workflow files: Regularly audit your workflow files for security issues
For more examples and use cases, check out the examples directory in the repository.
If you encounter any issues or have questions:
- Check the Troubleshooting section above
- Search existing Issues
- Create a new Issue with details about your problem
Coming Soon:
- Support for multiple notification channels (Slack, Discord, Email, etc.)
- Rich message formatting with attachments and media
- Customizable message templates for different event types
- Webhook support for real-time notifications
- Notification filtering and routing based on event types
- Integration with GitHub's native notification system
- Support for scheduled notifications and digest summaries
- Interactive buttons and inline keyboards in Telegram messages
- Support for sending files and media (images, documents, etc.)
- Rate limiting and retry mechanisms for reliable delivery
Thank you for considering contributing to GitHub Notify! See the CONTRIBUTING.md for details.
The MIT License (MIT). Please see License File for more information.