File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -118,4 +118,27 @@ jobs:
118118 --title "aShell You ${{ github.ref_name }}" \
119119 --notes-file changelog.txt
120120 env :
121- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
121+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
122+
123+ - name : Notify Telegram of New Release
124+ env :
125+ TELEGRAM_TOKEN : ${{ secrets.TELEGRAM_TOKEN }}
126+ CHAT_ID : ${{ secrets.CHAT_ID }}
127+ THREAD_ID : ${{ secrets.RELEASE_THREAD_ID }}
128+ run : |
129+ TAG=${{ github.ref_name }}
130+ URL="https://github.com/${{ github.repository }}/releases/tag/${TAG}"
131+
132+ # Escape underscores for MarkdownV2
133+ ESC_TAG=${TAG//_/\\_}
134+
135+ TEXT="🚀 *New Release Published*\n• *${ESC_TAG}*\n🔗 [View Release](${URL})"
136+
137+ REPLY='{"inline_keyboard":[[{"text":"View Release","url":"'"$URL"'"}]]}'
138+
139+ curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
140+ -d chat_id="$CHAT_ID" \
141+ -d parse_mode="MarkdownV2" \
142+ -d text="$TEXT" \
143+ -d reply_markup="$REPLY" \
144+ -d message_thread_id="$THREAD_ID"
You can’t perform that action at this time.
0 commit comments