Skip to content

Commit

Permalink
CI: Don't stall doc/build.sh link checker on problematic links
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Jan 21, 2025
1 parent 6319193 commit be5423d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ fi
echo
echo 'Testing for broken links'
echo
problematic_urls='
https://www.gnu.org/licenses/agpl-3.0.html
'
pushd "$BUILDROOT" >/dev/null
WEBSITE='https://kernc\.github\.io/backtesting\.py'
grep -PR '<a .*?href=' |
Expand Down Expand Up @@ -95,7 +98,10 @@ print(html.unescape(unquote(sys.argv[-1])))' "$url")"
if [ -f "$target_file" ]; then continue; fi

url="${url// /%20}"
curl --silent --fail --retry 5 --retry-delay 5 --user-agent 'Mozilla/5.0 Firefox 101' "$url" >/dev/null 2>&1 ||
echo "$url"
curl --silent --fail --retry 2 --retry-delay 2 --connect-timeout 10 \
--user-agent 'Mozilla/5.0 Firefox 128' "$url" >/dev/null 2>&1 ||
grep -qF "$url" <(echo "$problematic_urls") ||
die "broken link in $file: $url"
done
done
Expand Down

0 comments on commit be5423d

Please sign in to comment.