diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ba4ad35..83d88a8 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -125,11 +125,20 @@ jobs: # Documented placeholders, not hosts. *example.com*|*example.org*|*example.net*|*localhost*|*127.0.0.1*|*.invalid*) continue ;; esac + # github.com answers curl's blob pages with 503 most of the time + # (7 of 8 on 2026-10-10, all 3 attempts on every run), while the + # raw host answers 200 for a file and 404 for a missing one. A blob + # link claims "this file exists at this ref", so ask the raw host. + probe=$u + case "$u" in + https://github.com/*/*/blob/*) + probe=https://raw.githubusercontent.com/$(printf '%s' "${u#https://github.com/}" | sed -E 's#^([^/]+/[^/]+)/blob/#\1/#; s/[?#].*$//') ;; + esac # Three attempts: one is a flake detector rather than a link # checker, and a lane that fails at random gets ignored. code=000 for _ in 1 2 3; do - code=$(curl -sS -o /dev/null -w '%{http_code}' -L --max-time 25 "$u" 2>/dev/null) || true + code=$(curl -sS -o /dev/null -w '%{http_code}' -L --max-time 25 "$probe" 2>/dev/null) || true code=${code:-000} case "$code" in 2*|3*) break ;; esac sleep 3