Skip to content

Commit 37bef09

Browse files
committed
fix: 更新 tgmShare 群 ID 为正确的值
1 parent e8ce0d7 commit 37bef09

1 file changed

Lines changed: 32 additions & 18 deletions

File tree

.github/workflows/notify.yml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
name: Notify Multiple Telegram Chats on GitHub Push
2-
description: |
3-
This GitHub Action sends a notification to multiple Telegram chats whenever there is a push to the main branch.
4-
It uses the Telegram Bot API to send messages.
1+
name: Notify Telegram on GitHub Push
2+
description: 'Send notifications to Telegram groups (topics) and channel on push to main branch'
53
on:
64
push:
75
branches:
@@ -11,21 +9,37 @@ jobs:
119
notify:
1210
runs-on: ubuntu-latest
1311
steps:
14-
- name: Send commit message to multiple Telegram chats
12+
- name: Send notification to tgmShare group topic 5
1513
env:
1614
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
17-
CHAT_IDS: ${{ secrets.TELEGRAM_CHAT_IDS }}
1815
run: |
19-
echo "BOT_TOKEN: $BOT_TOKEN"
20-
echo "CHAT_IDS: $CHAT_IDS"
21-
IFS=',' read -ra IDS <<< "$CHAT_IDS"
22-
for chat in "${IDS[@]}"; do
23-
response=$(curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
24-
-d chat_id="$chat" \
25-
--data-urlencode "text= 📢 新资源增加啦!
26-
📝 提交内容: ${{ github.event.head_commit.message }}
27-
🔗 查看详情: https://github.com/${{ github.repository }}
28-
🔗 超过100T资料总站网站:https://doc.869hr.uk")
29-
echo "Telegram response for chat_id $chat: $response"
30-
done
16+
TEXT="📝 新增资源\n\n${{ github.event.head_commit.message }}\n\n🔗 超过100T资料总站网站:https://doc.869hr.uk\n📦 完整资源链接:https://t.me/dabaziyuan"
17+
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
18+
-d chat_id="-1002573762160" \
19+
-d message_thread_id="5" \
20+
-d parse_mode="Markdown" \
21+
--data-urlencode "text=${TEXT}"
3122
23+
- name: Send notification to tgmShareAI group topic 2
24+
env:
25+
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
26+
run: |
27+
TEXT="📝 新增资源\n\n${{ github.event.head_commit.message }}\n\n🔗 超过100T资料总站网站:https://doc.869hr.uk\n📦 完整资源链接:https://t.me/dabaziyuan"
28+
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
29+
-d chat_id="-1003365897434" \
30+
-d message_thread_id="2" \
31+
-d parse_mode="Markdown" \
32+
--data-urlencode "text=${TEXT}"
33+
34+
- name: Send full content to Telegram channel
35+
env:
36+
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
37+
CHANNEL_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }}
38+
run: |
39+
if [ -n "$CHANNEL_ID" ]; then
40+
TEXT="📦 新增资源推送\n\n${{ github.event.head_commit.message }}\n\n🔗 超过100T资料总站网站:https://doc.869hr.uk\n📂 查看详情:${{ github.event.head_commit.url }}"
41+
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
42+
-d chat_id="$CHANNEL_ID" \
43+
-d parse_mode="Markdown" \
44+
--data-urlencode "text=${TEXT}"
45+
fi

0 commit comments

Comments
 (0)