Skip to content

Commit b09c3e4

Browse files
authored
add tg notification
1 parent eeb1718 commit b09c3e4

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/daily-check-in.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,21 @@ jobs:
2828
PASSWORD: ${{ secrets.PASSWORD }}
2929
run: |
3030
python main.py
31+
32+
- name: Send Success Telegram Notification
33+
if: ${{ success() }} # 只有当执行成功时发送通知
34+
run: |
35+
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" \
36+
-d chat_id=${{ secrets.TELEGRAM_USERID }} \
37+
-d text="LINUX DO每日签到成功完成"
3138
39+
- name: Send Failure Telegram Notification
40+
if: ${{ failure() }} # 只有当执行失败时发送失败通知
41+
run: |
42+
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" \
43+
-d chat_id=${{ secrets.TELEGRAM_USERID }} \
44+
-d text="LINUX DO每日签到失败,请检查日志!"
45+
3246
- name: Delete workflow runs
3347
uses: Mattraks/delete-workflow-runs@v2
3448
with:

0 commit comments

Comments
 (0)