Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
message-square

GitHub Action

Telegram Notify

0.0.2

Telegram Notify

message-square

Telegram Notify

Sending a Telegram message

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Telegram Notify

uses: appleboy/[email protected]

Learn more about this action in appleboy/telegram-action

Choose a version

🚀 Telegram for GitHub Actions

GitHub Action for sending a Telegram notification message.

Usage

Send custom message as blow

action "Send Custom Message" {
  uses = "appleboy/telegram-action@master"
  secrets = [
    "TELEGRAM_TOKEN",
    "TELEGRAM_TO",
  ]
  args = "A new commit has been pushed."
}

Send the default message. Please remove args

action "Send Default Message" {
  uses = "appleboy/telegram-action@master"
  secrets = [
    "TELEGRAM_TOKEN",
    "TELEGRAM_TO",
  ]
}

Secrets

Getting started with Telegram Bot API.

  • TELEGRAM_TOKEN: Telegram authorization token.
  • TELEGRAM_TO: Unique identifier for this chat.

How to get unique identifier from telegram api:

$ curl https://api.telegram.org/bot<token>/getUpdates

See the result: (get chat id like 65382999)

{
  "ok": true,
  "result": [
    {
      "update_id": 664568113,
      "message": {
        "message_id": 8423,
        "from": {
          "id": 65382999,
          "is_bot": false,
          "first_name": "Bo-Yi",
          "last_name": "Wu (appleboy)",
          "username": "appleboy46",
          "language_code": "en"
        },
        "chat": {
          "id": 65382999,
          "first_name": "Bo-Yi",
          "last_name": "Wu (appleboy)",
          "username": "appleboy46",
          "type": "private"
        },
        "date": 1550333434,
        "text": "?"
      }
    }
  ]
}