This is a simple action to send message to Telegram chat with Telegram bot.
About Telegram bot, see official intrudoction.
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'
Required
Token of your Telegram bot, which you can get from BotFather.
You can put the token in secrets.
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.
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.
Define how to parse your message, markdown-style or HTML-style.
If you don't need this, not use this input is ok.
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.