From ae1c691ea2562cd22c61fe691cb446ea1ae5999e Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Mon, 25 Sep 2023 11:17:20 +0400 Subject: [PATCH] handle 204 code --- .github/workflows/announcements.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/announcements.yml b/.github/workflows/announcements.yml index 73675715..7d712e73 100644 --- a/.github/workflows/announcements.yml +++ b/.github/workflows/announcements.yml @@ -49,7 +49,7 @@ jobs: response=$(curl -s -w "HTTPSTATUS:%{http_code}" -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \ -d chat_id="${TELEGRAM_TO}" -d text="$content" -d parse_mode="Markdown") http_status=$(echo "$response" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') - if [ "$http_status" -ne 200 ]; then + if [ "$http_status" -ne 200 ] && [ "$http_status" -ne 204 ]; then echo "Error sending to Telegram. HTTP Status: $http_status" exit 1 fi @@ -60,7 +60,7 @@ jobs: response=$(curl -s -w "HTTPSTATUS:%{http_code}" -X POST -H "Content-Type: application/json" \ -d "{\"content\": $escaped_content}" https://discord.com/api/webhooks/1155501986532307056/POOHKkxip-2n4NA3Fe7ye1iPhrKeEwZOHiU2CSWCRt7TYv1uxvriNhZ0mat1JvLKpEsI) http_status=$(echo "$response" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') - if [ "$http_status" -ne 200 ]; then + if [ "$http_status" -ne 200 ] && [ "$http_status" -ne 204 ]; then echo "Error sending to Discord. HTTP Status: $http_status" exit 1 fi