
打通 RxJS 任督二脈
要能自動發訊息給 Telegram,首先要先申請 Telegram,過程還蠻簡單的
/newbot
並依照提示輸入資料,最終取得 tokenhttps://api.telegram.org/bot{{ token }}/getUpdates
,可以得到聊天訊息的 chat idresult[0].message.chat.id
以下 sample 為當 issue 有 comments 時發送 telegram 訊息
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
issue_comment:
types: [ created ]
jobs:
sendMessage:
runs-on: ubuntu-latest
steps:
- name: send telegram message on comment opened
uses: appleboy/[email protected]
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
From: ${{ github.event.sender.login }}
Title: ${{ github.event.issue.title }}
Link: ${{ github.event.comment.html_url }}
Body:
${{ github.event.comment.body }}