Skip to content

This is a simple action which send message to Telegram chat with Telegram bot.

Notifications You must be signed in to change notification settings

Juuroku/telegram-messaging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Messaging

This is a simple action to send message to Telegram chat with Telegram bot.
About Telegram bot, see official intrudoction.

telegram messaging test

Usage

Example: (see the whole file)

name: action name
on: [push]

jobs:
    job_name:
        runs-on: ubuntu-latest
        name: send message by telegram bot
        steps:
            - name: Send Message
              uses: Juuroku/telegram-messaging@master
              with: 
                telegram-token:  ${{ secrets.TELEGRAM_TOKEN }}
                telegram-chat: ${{ secrets.TELEGRAM_ID }}
                message: |
                    *Push Event Triggered*
                    REF: ${{ github.ref_name }}
                    COMMIT: ${{ github.event.head_commit.message }}
                    
                parse: 'markdown'

Inputs

telegram-token

Required
Token of your Telegram bot, which you can get from BotFather.
You can put the token in secrets.

telegram-chat

Required
ID of the chat you want to send to. You need to send a message to the chat and get it from getUpdates API.
You can put the chat id in secrets.

message

Required
Content you want to send, can be witten in markdown-style or HTML-style.
If using markdown-style or HTML-style, please check official documention to avoid invalid syntax.
For example, while using markdown-style, .(dot) must be escaped if not in pre, code or inline links, so you have to process URL first or always treat them as inline links.
See Contexts for more variables to use.

parse

Define how to parse your message, markdown-style or HTML-style.
If you don't need this, not use this input is ok.

Output

The action will set an output named status after execution.
If the response from the api server said OK, status will be Message Sent.
Otherwise, it will be {HTTP Status Code} - {Description Got from Server}.
If you did not set any step after the action, the output will show on action page.
Or you can use the output to decide what to do next.

About

This is a simple action which send message to Telegram chat with Telegram bot.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published