Update release-to-telegram.yml

This commit is contained in:
Zhe Fang
2025-07-28 19:38:47 -04:00
committed by GitHub
parent 1b7f53c055
commit 01776ed9a8

View File

@@ -1,4 +1,4 @@
name: Notify Telegram on Release
name: Notify Telegram on GitHub Release
on:
release:
@@ -8,15 +8,20 @@ jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send message to Telegram
- name: Send release info to Telegram
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
RELEASE_URL: ${{ github.event.release.html_url }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
RELEASE_NAME: ${{ github.event.release.name }}
RELEASE_BODY: ${{ github.event.release.body }}
run: |
curl -s -X POST https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage \
-d chat_id=${CHAT_ID} \
-d text="🚀 New Release *${RELEASE_TAG}* - ${RELEASE_NAME}\n[View on GitHub](${RELEASE_URL})" \
-d parse_mode=Markdown
TEXT="🚀 *New Release:* ${RELEASE_TAG} - ${RELEASE_NAME}%0A"
TEXT+="📝 *Description:*%0A${RELEASE_BODY}%0A"
TEXT+="🔗 [View on GitHub](${RELEASE_URL})"
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
-d chat_id="${CHAT_ID}" \
-d text="${TEXT}" \
-d parse_mode=Markdown