Skip to content

Commit

Permalink
add telegram notification for failed pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
antonaleks committed Jan 10, 2024
1 parent e66c412 commit ee7b7f4
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions .github/workflows/modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,25 @@ jobs:
run: terraform fmt -diff -check -recursive

- name: Init Terraform
run: terraformTESTFAILJOB init
run: terraform init

- name: Terraform apply
run: terraform apply -auto-approve

- 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}}
- 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}}

0 comments on commit ee7b7f4

Please sign in to comment.