From 0884f2f18a87822837688dc94c1b54471d56fb12 Mon Sep 17 00:00:00 2001 From: Forge Date: Fri, 6 Mar 2026 14:02:25 +0800 Subject: [PATCH] feat: add Telegram notifications on CI success/failure --- .gitea/workflows/ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 9741a5d..75460f6 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -60,3 +60,19 @@ jobs: echo "✅ Published: https://git.juankibin.space/kibin/-/packages" env: PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }} + + - name: Notify Success + if: success() + run: | + SHA=$(echo "${{ gitea.sha }}" | cut -c1-7) + curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \ + -d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" \ + -d "text=✅ LexAI CI Passed%0A%0ABranch: ${{ gitea.ref_name }}%0ACommit: ${SHA}%0A%0AAll steps green — new build published to packages." + + - name: Notify Failure + if: failure() + run: | + SHA=$(echo "${{ gitea.sha }}" | cut -c1-7) + curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \ + -d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" \ + -d "text=❌ LexAI CI FAILED%0A%0ABranch: ${{ gitea.ref_name }}%0ACommit: ${SHA}%0A%0ACheck: https://git.juankibin.space/kibin/LexAI/actions"