Skip to content

Commit

Permalink
feat: auto send message to telegram after build finish
Browse files Browse the repository at this point in the history
  • Loading branch information
Nguyen Quang Minh committed Sep 6, 2024
1 parent c187bb4 commit 53f76ac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,17 @@ jobs:
- name: Send Telegram Notification on Success
if: success()
run: |
ARTIFACT_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ github.run_number }}"
MESSAGE="✅ *Build Succeeded*\n\n*Committer*: ${{ github.actor }}\n*Commit Message*: ${{ github.event.head_commit.message }}\n\n[Download APK](${ARTIFACT_URL})"
ACTION_LINK="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
MESSAGE="✅ *Build Succeeded* \n
*Committer*: ${{ github.actor }} \n
*Commit Message*: ${{ github.event.head_commit.message }} \n
[ACTION LINK](${ACTION_LINK})"
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
-d parse_mode="MarkdownV2" \
-d text="${MESSAGE}"
- name: Send Telegram Notification on Failure
if: failure()
Expand Down

0 comments on commit 53f76ac

Please sign in to comment.