From e2e72846e658ffd0a95ed8167b5843ef92cf5dda Mon Sep 17 00:00:00 2001 From: ShanaiaBot Date: Sat, 4 Apr 2026 01:49:47 +0200 Subject: [PATCH] ci: fix telegram notification --- .gitea/workflows/build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 87cbdf5..8863ce4 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -86,11 +86,15 @@ jobs: export PATH="/opt/homebrew/bin:$PATH" VERSION=$(grep 'version:' pubspec.yaml | head -1 | sed 's/version: //' | sed 's/+.*//') VERSION="v${VERSION}" - BOT_TOKEN=$(grep -A1 "TELEGRAM_BOT_TOKEN" /Users/freetlab/Library/LaunchAgents/ai.openclaw.gateway.plist | grep string | sed 's/.*\(.*\)<\/string>/\1/' | tr -d '[:space:]') + BOT_TOKEN=$(plutil -extract ':EnvironmentVariables:TELEGRAM_BOT_TOKEN' raw /Users/freetlab/Library/LaunchAgents/ai.openclaw.gateway.plist 2>/dev/null || echo "") + if [ -z "$BOT_TOKEN" ]; then + echo "No bot token found, skipping notification" + exit 0 + fi if [ "${{ job.status }}" = "success" ]; then - MSG="✅ Farolero ${VERSION} — Build OK%0AAPK + AAB en builds.freetimelab.es" + MSG="✅ Farolero ${VERSION} — Build OK. APK + AAB en builds.freetimelab.es" else MSG="❌ Farolero ${VERSION} — Build FAILED" fi curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \ - -d "chat_id=221721467&text=${MSG}" > /dev/null 2>&1 || true + -d "chat_id=221721467" -d "text=${MSG}" || true