Skip to content

增加 罗翔法律思维课|谈刑论道喜马拉雅VIP专辑(法考必听+刑法案例解析) #10

增加 罗翔法律思维课|谈刑论道喜马拉雅VIP专辑(法考必听+刑法案例解析)

增加 罗翔法律思维课|谈刑论道喜马拉雅VIP专辑(法考必听+刑法案例解析) #10

Workflow file for this run

name: Notify Multiple Telegram Chats on GitHub Push
description: |
This GitHub Action sends a notification to multiple Telegram chats whenever there is a push to the main branch.
It uses the Telegram Bot API to send messages.
on:
push:
branches:
- main
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send commit message to multiple Telegram chats
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
CHAT_IDS: ${{ secrets.TELEGRAM_CHAT_IDS }}
run: |
echo "BOT_TOKEN: $BOT_TOKEN"
echo "CHAT_IDS: $CHAT_IDS"
IFS=',' read -ra IDS <<< "$CHAT_IDS"
for chat in "${IDS[@]}"; do
response=$(curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
-d chat_id="$chat" \
--data-urlencode "text=
📝 新增资源: ${{ github.event.head_commit.message }}
🔗 查看详情: ${{ github.event.head_commit.url }}")
echo "Telegram response for chat_id $chat: $response"
done