Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: properly handle double quotes in TG notifications

Andrey Lushnikova8c6bd66cd2e
diff --git a/browser_patches/buildbots/send_telegram_message.sh b/browser_patches/buildbots/send_telegram_message.sh
index 283885cf12..2b70e2927a 100644
--- a/browser_patches/buildbots/send_telegram_message.sh
+++ b/browser_patches/buildbots/send_telegram_message.sh
@@ -5,9 +5,10 @@ send_telegram_message() {
if ! command -v curl >/dev/null; then
return;
fi
+ local TEXT=${1//\"/\\\"}
curl --silent \
-X POST \
-H 'Content-Type: application/json' \
- -d '{"chat_id": "-1001225613794", "parse_mode": "html", "text": "'"$1"'", "disable_notification": false}' \
+ -d '{"chat_id": "-1001225613794", "parse_mode": "html", "text": "'"$TEXT"'", "disable_notification": false}' \
https://api.telegram.org/bot$TELEGRAM_BOT_KEY/sendMessage >/dev/null
}