From 4956fbe1ba19af9a83640560b2240ff526546b67 Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Thu, 20 Mar 2025 15:56:18 +0300 Subject: [PATCH] T: Add telegram reporting --- .github/workflows/backend.yml | 13 +++++++++++++ .github/workflows/frontend.yml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 1478643f..95e8f6ab 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -40,3 +40,16 @@ jobs: run: | python manage.py check python manage.py test + notify-failure: + runs-on: ubuntu-latest + needs: build + if: failure() + defaults: + run: + working-directory: . + steps: + - name: Send Telegram Notification + run: | + curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \ + -d chat_id=${{ secrets.TELEGRAM_CHAT_ID }} \ + -d text="❌ Backend build failed! Repository: ${{ github.repository }} Commit: ${{ github.sha }}" diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 9d94cd0c..ffae0672 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -49,3 +49,16 @@ jobs: name: playwright-report path: playwright-report/ retention-days: 30 + notify-failure: + runs-on: ubuntu-latest + needs: build + if: failure() + defaults: + run: + working-directory: . + steps: + - name: Send Telegram Notification + run: | + curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \ + -d chat_id=${{ secrets.TELEGRAM_CHAT_ID }} \ + -d text="❌ Front build failed! Repository: ${{ github.repository }} Commit: ${{ github.sha }}"