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

GitHub Action

Telegram Msg

2.0.0

Telegram Msg

message-circle

Telegram Msg

Send Message To Telegram

Installation

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

              

- name: Telegram Msg

uses: colutius/[email protected]

Learn more about this action in colutius/Telegram-Msg

Choose a version

Telegram-Msg

通过actions向telegram发送消息

test

开始使用

发送一条自定义消息

name: Telegram-Msg
on: [push]
jobs:
  sendMsg:
    name: sendMsg
    runs-on: ubuntu-latest
    steps:
    - uses: colutius/Telegram-Msg@main
      with:
        token: ${{ secrets.TELEGRAM_TOKEN }}
        chatid: ${{ secrets.TELEGRAM_TO }}
        message: |
          👇新的提交👇
          
          👤提交人: [${{ github.actor }}]

          📄提交信息: ${{ github.event.commits[0].message }}

          📦仓库: ${{ github.repository }}
        button: true
        button_name: 👀查看更改👀
        button_url: https://github.com/${{ github.repository }}/commit/${{github.sha}}

不加可选参数发送默认消息

- uses: colutius/Telegram-Msg@main
  with:
    token: ${{ secrets.TELEGRAM_TOKEN }}
    chatid: ${{ secrets.TELEGRAM_TO }}

可选参数

  • button: truefalse,是否添加链接按钮,默认为true
  • button_name: 按钮名称,默认为👀查看更改👀
  • button_url: 按钮链接地址,默认为https://github.com/${{ github.repository }}/commit/${{github.sha}}

Secrets

  • token: Telegram bot token
  • chatid: chat id