Skip to content

Commit

Permalink
handle 204 code
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Sep 25, 2023
1 parent 0735203 commit ae1c691
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/announcements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ae1c691

Please sign in to comment.