diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index c2baf94..99de0fd 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -31,9 +31,12 @@ jobs: https://hivecommons.dev/llms.txt https://hivecommons.dev/sitemap.xml \ https://hivecommons.dev/robots.txt \ https://hivecommons.dev/404.html; do + # `|| true` keeps a curl transport failure (DNS, TLS, timeout) from + # tripping `set -e` before the ::error:: line below is printed; + # --write-out still yields 000 in that case, which fails the != 200 test. status=$(curl --silent --show-error --output /dev/null \ --write-out '%{http_code}' --connect-timeout 10 --max-time 30 \ - --retry 2 --retry-delay 5 "$url") + --retry 2 --retry-delay 5 "$url" || true) if [[ "$status" != 200 ]]; then echo "::error::Live page $url returned HTTP $status (expected 200)" exit 1