Create the bot
Go to the botfather and create a bot.
/newbot
I named mine "the focus build bot" and "thefocus_build_bot"
Save the secret somewhere careful. In TELEGRAM_BOT_TOKEN say.
Get a chat id
Send a message in your bot’s chat:
- In Telegram, search for your newly created bot by its username (the one ending in “bot”).
- Press Start to initiate the chat.
- Send a short message, like “Hello.”
Then go to https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates in
your browser. You should be able to see the chat id there.
Save it in TELEGRAM_CHAT_ID
Send a test message from your machine
| |
{
"ok": true,
"result": {
"message_id": 6,
"from": {
"id": 8073526226,
"is_bot": true,
"first_name": "Focus Build Bot",
"username": "thefocus_build_bot"
},
"chat": {
"id": 5920486792,
"first_name": "Will",
"last_name": "Schenk",
"type": "private"
},
"date": 1741645616,
"text": "❌ BOOM ❌"
}
}
Add the secrets to your repository
| |
And you can to go
| |
Settings > Secrets and Variables > Actions to see if they are there.
Adding to the github action
Inside of whatever your github action is, put this at the end of the build set.
| |
Deploy and enjoy
Push and see that alert come in!