File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Weekly External Link Check
2+ on :
3+ schedule :
4+ # Every Monday at 08:00 UTC
5+ - cron : " 0 8 * * 1"
6+ workflow_dispatch :
7+ permissions :
8+ contents : read
9+ jobs :
10+ link-check :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Set up Git repository
14+ uses : actions/checkout@v7
15+ - name : Set up Ruby
16+ uses : ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74
17+ - name : Get NodeJS version
18+ run : echo "NODE_VERSION=$(cat .node-version)" >> $GITHUB_OUTPUT
19+ id : node_version
20+ - name : Set up NodeJS
21+ uses : actions/setup-node@v6.4.0
22+ with :
23+ node-version : " ${{ steps.node_version.outputs.NODE_VERSION }}"
24+ - name : Bootstrap
25+ run : script/bootstrap
26+ - name : Build site
27+ run : script/build
28+ - name : Check links (including external URLs)
29+ run : bundle exec script/html-proofer
30+ env :
31+ CHECK_EXTERNAL_LINKS : true
Original file line number Diff line number Diff line change 11#!/usr/bin/env ruby
22require "html-proofer"
33
4+ # External (remote) link checking is opt-in.
5+ # Set CHECK_EXTERNAL_LINKS=true to enable (used by weekly scheduled run).
6+ check_external = %w[ 1 true yes ] . include? (
7+ ENV . fetch ( "CHECK_EXTERNAL_LINKS" , "" ) . strip . downcase
8+ )
9+
10+ if check_external
11+ puts "==> Running HTMLProofer WITH external link checks"
12+ else
13+ puts "==> Running HTMLProofer WITHOUT external link checks " \
14+ "(set CHECK_EXTERNAL_LINKS=true to enable)"
15+ end
16+
417url_ignores = [
518 "http://comcast.com" ,
619]
720
821HTMLProofer . check_directories (
922 [ "_site" ] ,
23+ disable_external : !check_external ,
1024 enforce_https : false ,
1125 ignore_status_codes : [ 429 ] ,
1226 ignore_urls : url_ignores ,
Original file line number Diff line number Diff line change 33set -e
44
55script/build
6- bundle exec script/html-proofer
6+
7+ # Skip external URL checks in normal CI. They are slow and frequently fail
8+ # due to rate limiting on third-party sites. The full external link check
9+ # runs on a weekly schedule (see .github/workflows/link-check.yml).
10+ CHECK_EXTERNAL_LINKS=false bundle exec script/html-proofer
You can’t perform that action at this time.
0 commit comments