@@ -743,17 +743,40 @@ jobs:
743
743
curl -H "Content-Type: application/json" \
744
744
-d "{\"content\": \"${APK_MESSAGE}\n${WINDOWS_MESSAGE}\n${LINUX_MESSAGE}\n${IOS_MESSAGE}\n${MACOS_MESSAGE}\"}" \
745
745
"${{ secrets.DISCORD_WEBHOOK_URL }}"
746
+
746
747
- name : Send Telegram Notification
747
748
run : |
748
- response=$(curl -sS -f -X POST \
749
- "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKKEN}}/sendMessage" \
750
- -F "chat_id=${{ secrets.TELEGRAM_CHANNEL_ID}}" \
751
- -F "message_thread_id=${{secrets.TELEGRAM_THREAD_ID}}" \
749
+ MESSAGE="🎉 *Build Notification* 🎉"
750
+
751
+ if [[ -n "${{ env.apk_message }}" ]]; then
752
+ MESSAGE="$MESSAGE
753
+ ${{ env.apk_message }}"
754
+ fi
755
+ if [[ -n "${{ env.windows_message }}" ]]; then
756
+ MESSAGE="$MESSAGE
757
+ ${{ env.windows_message }}"
758
+ fi
759
+ if [[ -n "${{ env.linux_message }}" ]]; then
760
+ MESSAGE="$MESSAGE
761
+ ${{ env.linux_message }}"
762
+ fi
763
+ if [[ -n "${{ env.ios_message }}" ]]; then
764
+ MESSAGE="$MESSAGE
765
+ ${{ env.ios_message }}"
766
+ fi
767
+ if [[ -n "${{ env.macos_message }}" ]]; then
768
+ MESSAGE="$MESSAGE
769
+ ${{ env.macos_message }}"
770
+ fi
771
+
772
+ if [[ "$MESSAGE" != "🎉 *Build Notification* 🎉" ]]; then
773
+ curl -sS -f -X POST \
774
+ " https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKKEN }}/sendMessage" \
775
+ -F "chat_id=${{ secrets.TELEGRAM_CHANNEL_ID }}" \
776
+ -F "message_thread_id=${{ secrets.TELEGRAM_THREAD_ID }}" \
752
777
-F parse_mode="Markdown" \
753
778
-F disable_notification=true \
754
- -F "text=🎉 *Build Notification* 🎉
755
- ${{ env.apk_message }}
756
- ${{ env.windows_message }}
757
- ${{ env.linux_message }}
758
- ${{ env.ios_message }}
759
- ${{ env.macos_message }}")
779
+ -F "text=$MESSAGE"
780
+ else
781
+ echo "No download links found. Skipping Telegram notification."
782
+ fi
0 commit comments