Skip to content

Telegram Notify

Telegram Notify #153

name: Telegram Notify
on:
workflow_run:
workflows: ["Release"]
types: [completed]
permissions:
contents: read
jobs:
# ---- Release notification (only after Release workflow passes) ----
release:
if: >-
github.event.workflow_run.name == 'Release'
&& github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Extract version from tag
id: ver
run: |
TAG=$(git describe --tags --exact-match "${{ github.event.workflow_run.head_sha }}" 2>/dev/null || echo "")
if [ -z "$TAG" ]; then
echo "No tag found for this commit, skipping"
echo "found=false" >> "$GITHUB_OUTPUT"
else
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
echo "found=true" >> "$GITHUB_OUTPUT"
fi
- name: Send release to Telegram
if: steps.ver.outputs.found == 'true'
uses: appleboy/telegram-action@v1.0.1
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
format: html
disable_web_page_preview: true
message: |
🚀 <b>New Release ${{ steps.ver.outputs.tag }}</b>
Teleton ${{ steps.ver.outputs.version }} is now available on npm.
Update your agents:
<code>npm i -g teleton@latest</code>
<a href="https://github.com/${{ github.repository }}/releases/tag/${{ steps.ver.outputs.tag }}">View release</a>