mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 19:24:55 +08:00
Create telegram-notification.yml
This commit is contained in:
36
.github/workflows/telegram-notification.yml
vendored
Normal file
36
.github/workflows/telegram-notification.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# 幫這個 action 取個名字,會在 action 頁面的左側顯示
|
||||
name: Telegram Notification
|
||||
|
||||
# 要在什麼時候觸發,實測只設定 push 沒有限定更細的 type 或條件時,
|
||||
# 新增 tag、設定 release 等活動都會觸發
|
||||
on:
|
||||
release
|
||||
|
||||
# 設定 job 的內容
|
||||
jobs:
|
||||
|
||||
bulid:
|
||||
# 被觸發後,點進上面的名稱後,這邊的名稱會顯示在流程頁面中
|
||||
name: Build
|
||||
# action 執行的環境
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# 再點入上面的流程看詳細執行狀況時,會顯示下面的名字
|
||||
- name: send message on release
|
||||
# 使用這個專案已經寫好的 action
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
# 將剛剛拿到的參數帶入,讓流程能夠正確將訊息發到指定的聊天室
|
||||
to: ${{ secrets.TELEGRAM_BOT_ID }}
|
||||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||||
# 設定要發出的訊息格式,以下是參考原始 repo 後稍微改寫的設定
|
||||
# github.actor: 觸發 event 的使用者名稱
|
||||
# github.sha: commit 的 hash 值
|
||||
# github.event.commits[0].message: commit message
|
||||
# github.repository: repository 的名稱
|
||||
message: |
|
||||
${{ github.actor }} created commit:
|
||||
Commit message: ${{ github.event.commits[0].message }}
|
||||
Repository: ${{ github.repository }}
|
||||
|
||||
https://github.com/${{ github.repository }}/commit/${{github.sha}}
|
||||
Reference in New Issue
Block a user