From 1c8b0724ae179708c48061e5074f6d3536cf22cb Mon Sep 17 00:00:00 2001 From: primoco <58369875+primoco@users.noreply.github.com> Date: Thu, 25 Jun 2026 11:10:02 +0200 Subject: [PATCH 1/2] chore: add Telegram failure notification to CI --- .github/workflows/ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7842991..664beb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,3 +23,19 @@ jobs: - name: test run: cargo test + + - name: Notify Telegram on failure + if: failure() + continue-on-error: true + env: + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + run: | + if [ -z "$TELEGRAM_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then + echo "Telegram secrets not configured, skipping notification" + exit 0 + fi + curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \ + -d chat_id="${TELEGRAM_CHAT_ID}" \ + -d parse_mode="HTML" \ + -d text="❌ CI failed on ${{ github.ref_name }}%0A${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" From 2072c92ec4755171a8364c7277e9166ebb77a2f5 Mon Sep 17 00:00:00 2001 From: primoco <58369875+primoco@users.noreply.github.com> Date: Thu, 25 Jun 2026 11:13:58 +0200 Subject: [PATCH 2/2] chore: add Telegram notifications to release workflow --- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 259f7ff..2f1fd18 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,6 +81,20 @@ jobs: ${{ matrix.archive }} ${{ matrix.archive }}.sha256 + - name: Notify Telegram on build failure + if: failure() + continue-on-error: true + shell: bash + env: + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + run: | + if [ -z "$TELEGRAM_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then exit 0; fi + curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \ + -d chat_id="${TELEGRAM_CHAT_ID}" \ + -d parse_mode="HTML" \ + -d text="❌ Release build failed%0APlatform: ${{ matrix.target }}%0ATag: ${{ github.ref_name }}%0A${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + release: needs: build runs-on: ubuntu-latest @@ -92,7 +106,34 @@ jobs: path: artifacts - uses: softprops/action-gh-release@v2 + id: gh_release with: files: artifacts/** fail_on_unmatched_files: false generate_release_notes: true + + - name: Notify Telegram on release published + if: success() + continue-on-error: true + env: + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + run: | + if [ -z "$TELEGRAM_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then exit 0; fi + curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \ + -d chat_id="${TELEGRAM_CHAT_ID}" \ + -d parse_mode="HTML" \ + -d text="✅ Release published: ${{ github.ref_name }}%0A${{ steps.gh_release.outputs.url }}" + + - name: Notify Telegram on release failure + if: failure() + continue-on-error: true + env: + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + run: | + if [ -z "$TELEGRAM_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then exit 0; fi + curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \ + -d chat_id="${TELEGRAM_CHAT_ID}" \ + -d parse_mode="HTML" \ + -d text="❌ Release job failed for tag ${{ github.ref_name }}%0A${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"