ci: fix telegram notification
All checks were successful
Build & Deploy Farolero / build (push) Successful in 1m1s

This commit is contained in:
ShanaiaBot
2026-04-04 01:49:47 +02:00
parent e84b45b6ff
commit e2e72846e6

View File

@@ -86,11 +86,15 @@ jobs:
export PATH="/opt/homebrew/bin:$PATH" export PATH="/opt/homebrew/bin:$PATH"
VERSION=$(grep 'version:' pubspec.yaml | head -1 | sed 's/version: //' | sed 's/+.*//') VERSION=$(grep 'version:' pubspec.yaml | head -1 | sed 's/version: //' | sed 's/+.*//')
VERSION="v${VERSION}" VERSION="v${VERSION}"
BOT_TOKEN=$(grep -A1 "TELEGRAM_BOT_TOKEN" /Users/freetlab/Library/LaunchAgents/ai.openclaw.gateway.plist | grep string | sed 's/.*<string>\(.*\)<\/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 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 else
MSG="❌ Farolero ${VERSION} — Build FAILED" MSG="❌ Farolero ${VERSION} — Build FAILED"
fi fi
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \ 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