add: tg bot

This commit is contained in:
windingwind 2024-08-02 22:09:37 +08:00
parent 98990a50e5
commit f3fe11f40d

19
.github/workflows/tgbot.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Notify Telegram on Release
on:
release:
types: [published]
jobs:
send_message:
runs-on: ubuntu-latest
steps:
- name: Send Telegram Message
run: |
msg_text='
📢 A new release of ${{ github.repository }} is published: ${{ github.event.release.tag_name }}
Release Name: ${{ github.event.release.name }}
Description: ${{ github.event.release.body }}
You can check updates in Zotero to get the latest version, or view on GitHub: ${{ github.event.release.html_url }}'
curl -s -X POST 'https://api.telegram.org/bot${{ secrets.TG_BOT_TOKEN }}/sendMessage' \
-d "chat_id=${{ secrets.TG_CHAT_ID }}&text=${msg_text}&reply_to_message_id=${{ secrets.TG_MSG_ID }}"