From ee7b7f4056f88d67db58289e240833dcf5f410a8 Mon Sep 17 00:00:00 2001 From: "alekseev.ap605" Date: Wed, 10 Jan 2024 17:30:32 +0300 Subject: [PATCH] add telegram notification for failed pipeline --- .github/workflows/modules.yml | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml index 5c1a80f..baf76bd 100644 --- a/.github/workflows/modules.yml +++ b/.github/workflows/modules.yml @@ -39,7 +39,7 @@ jobs: run: terraform fmt -diff -check -recursive - name: Init Terraform - run: terraformTESTFAILJOB init + run: terraform init - name: Terraform apply run: terraform apply -auto-approve @@ -47,21 +47,17 @@ jobs: - name: Terraform destroy run: terraform destroy -auto-approve - notify: - name: 'Telegram notify' - runs-on: self-hosted - if: ${{ failure() }} - steps: - - name: send telegram message on failure - uses: appleboy/telegram-action@master - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_TOKEN }} - message: | - Terraform modules build pipeline was failed - - Action: $GITHUB_ACTION_PATH - - Repository: ${{ github.repository }} - - See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}} \ No newline at end of file + - name: Telegram notify if job was failed + if: ${{ failure() }} + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_TO }} + token: ${{ secrets.TELEGRAM_TOKEN }} + message: | + Terraform modules build pipeline was failed + + Action: $GITHUB_ACTION_PATH + + Repository: ${{ github.repository }} + + See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}} \ No newline at end of file