From f591f1c15ddff783a92f4804ece90e4649e7dfef Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Sat, 27 Mar 2021 03:14:57 +0900 Subject: [PATCH] Improve notification message --- .github/workflows/github_pre_release.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github_pre_release.yml b/.github/workflows/github_pre_release.yml index cda982ae..33d195ee 100644 --- a/.github/workflows/github_pre_release.yml +++ b/.github/workflows/github_pre_release.yml @@ -48,11 +48,21 @@ jobs: name: barinsta_pre-release_${{ steps.date.outputs.date }} path: ${{steps.sign_app.outputs.signedReleaseFile}} - # Send Telegram notification - - name: Send Telegram notification + # Send success notification + - name: Send success Telegram notification + if: ${{ success() }} uses: appleboy/telegram-action@master with: to: ${{ secrets.TELEGRAM_BUILDS_CHANNEL_TO }} token: ${{ secrets.TELEGRAM_BUILDS_BOT_TOKEN }} - message: Build successful + message: "${{ github.workflow }} ${{ github.job }} #${{ github.run_number }} completed successfully.\nURL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" document: ${{steps.sign_app.outputs.signedReleaseFile}} + + # Send failure notification + - name: Send failure Telegram notification + if: ${{ failure() }} + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_BUILDS_CHANNEL_TO }} + token: ${{ secrets.TELEGRAM_BUILDS_BOT_TOKEN }} + message: "${{ github.workflow }} ${{ github.job }} #${{ github.run_number }} failed.\nURL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"