Create release-to-telegram.yml

This commit is contained in:
Zhe Fang
2025-07-28 19:34:59 -04:00
committed by GitHub
parent 3233d35a05
commit 1b7f53c055

View File

@@ -0,0 +1,22 @@
name: Notify Telegram on Release
on:
release:
types: [published]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send message 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 }}
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