improve error handling for GAS response in workflow
This commit is contained in:
parent
430d5d40fc
commit
e0cf1f94fc
1 changed files with 11 additions and 5 deletions
16
.github/workflows/version-check.yml
vendored
16
.github/workflows/version-check.yml
vendored
|
|
@ -88,11 +88,17 @@ jobs:
|
|||
'. + {buildType: $buildType, source: $source}')
|
||||
fi
|
||||
|
||||
response=$(curl -s -L -X POST "$g" -H "Content-Type: application/json" --data-raw "$final_json")
|
||||
echo "Отправка данных на GAS..."
|
||||
|
||||
if echo "$response" | grep -q "text-align:center"; then
|
||||
clean_response=$(echo "$response" | grep "text-align:center" | sed 's/<[^>]*>//g' | xargs)
|
||||
echo "Ответ от GAS: $clean_response"
|
||||
response=$(curl -s -L -X POST "$g" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data-raw "$final_json")
|
||||
|
||||
if echo "$response" | grep -q "<!DOCTYPE html>"; then
|
||||
echo "Ошибка: получен HTML вместо текстового ответа"
|
||||
echo "Полученный HTML:"
|
||||
echo "$response"
|
||||
exit 1
|
||||
else
|
||||
echo "Ответ от GAS: $response"
|
||||
fi
|
||||
fi
|
||||
Loading…
Reference in a new issue