build: Log HTTP response codes

Added HTTP response code logging in the check function.
This commit is contained in:
Kroese 2026-03-23 13:46:50 +01:00 committed by GitHub
parent d8e51d8965
commit 6e104b2cf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,8 +31,10 @@ jobs:
check() { check() {
local url="$1" http local url="$1" http
http=$(curl -sSL -o /dev/null -w "%{http_code}" --max-time 10 -I -- "$url" 2>&1) || http="000" http=$(curl -sSL -o /dev/null -w "%{http_code}" --max-time 10 -I -- "$url" 2>&1) || http="000"
printf '%s\n' "HTTP: $http"
[[ "$http" == 2* ]] && return 0 [[ "$http" == 2* ]] && return 0
http=$(curl -sSL -o /dev/null -w "%{http_code}" --max-time 10 -r "0-0" -- "$url" 2>&1) || http="000" http=$(curl -sSL -o /dev/null -w "%{http_code}" --max-time 10 -r "0-0" -- "$url" 2>&1) || http="000"
printf '%s\n' "HTTP: $http"
[[ "$http" == 2* ]] [[ "$http" == 2* ]]
} }
while IFS= read -r line; do while IFS= read -r line; do