From bb9db2f9a25097e4fd8de9b9468ae9ca6432526c Mon Sep 17 00:00:00 2001 From: Oliver Eggert Date: Wed, 20 May 2026 15:16:49 -0700 Subject: [PATCH 1/3] initial commit --- .github/workflows/link-check.yml | 66 ++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/link-check.yml diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 00000000000..21d11f04958 --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,66 @@ +name: Link check + +on: + pull_request: + branches: [master] + workflow_dispatch: + +concurrency: + group: link-check-${{ github.ref }} + cancel-in-progress: true + +jobs: + link-check: + runs-on: ubuntu-latest + timeout-minutes: 30 + env: + PORT: 4000 + BASE_URL: http://localhost:4000 + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: npm + + - run: npm ci + + - name: Build CSS + run: npm run build-css + + - name: Start Realm dev server + run: | + npx realm develop --port "$PORT" > realm.log 2>&1 & + echo $! > realm.pid + + - name: Wait for server + run: npx --yes wait-on "$BASE_URL" --timeout 180000 + + - name: Crawl and check links + run: | + npx --yes linkinator@^6 "$BASE_URL" \ + --recurse \ + --retry \ + --timeout 20000 \ + --concurrency 5 \ + --skip "$BASE_URL/@l10n/(?!en-US)" \ + --skip "^https?://(twitter|x)\.com" \ + --skip "^https?://(www\.)?linkedin\.com" \ + --format csv > linkinator-report.csv + + - name: Stop Realm server + if: always() + run: | + if [ -f realm.pid ]; then kill "$(cat realm.pid)" 2>/dev/null || true; fi + + - name: Upload report + if: always() + uses: actions/upload-artifact@v4 + with: + name: link-check-report + path: | + linkinator-report.csv + realm.log + if-no-files-found: warn From 8d57aca0250e74627b7ac6c564813e8f1089ebc4 Mon Sep 17 00:00:00 2001 From: Oliver Eggert Date: Wed, 20 May 2026 16:53:13 -0700 Subject: [PATCH 2/3] add linkchecker workflow --- .github/workflows/link-check.yml | 8 +------- .gitignore | 4 ++++ linkinator.config.json | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 linkinator.config.json diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 21d11f04958..92049d214c5 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -41,13 +41,7 @@ jobs: - name: Crawl and check links run: | npx --yes linkinator@^6 "$BASE_URL" \ - --recurse \ - --retry \ - --timeout 20000 \ - --concurrency 5 \ - --skip "$BASE_URL/@l10n/(?!en-US)" \ - --skip "^https?://(twitter|x)\.com" \ - --skip "^https?://(www\.)?linkedin\.com" \ + --config linkinator.config.json \ --format csv > linkinator-report.csv - name: Stop Realm server diff --git a/.gitignore b/.gitignore index 359a51cad53..5fe044ba0ad 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,7 @@ _code-samples/*/*/*[Ss]etup.json # PHP composer.lock + +# Link checker artifacts +linkinator-report.csv +realm.log diff --git a/linkinator.config.json b/linkinator.config.json new file mode 100644 index 00000000000..e8b52e09922 --- /dev/null +++ b/linkinator.config.json @@ -0,0 +1,22 @@ +{ + "recurse": true, + "retry": true, + "timeout": 20000, + "concurrency": 5, + "skip": [ + "http://localhost:4000/@l10n/(?!en-US)", + "^https?://(twitter|x)\\.com", + "^https?://(www\\.)?linkedin\\.com", + "^https?://chat\\.openai\\.com", + "^https?://chatgpt\\.com", + "^https?://claude\\.ai", + "^https?://(www\\.)?medium\\.com" + ], + "headers": { + "*": { + "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "Accept-Language": "en-US,en;q=0.9" + } + } +} From 99734465ba8d793aee4f6c4bf803fff885ebf565 Mon Sep 17 00:00:00 2001 From: Oliver Eggert Date: Wed, 20 May 2026 17:42:50 -0700 Subject: [PATCH 3/3] update timeout to 60 mins --- .github/workflows/link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 92049d214c5..baa6e79e098 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -12,7 +12,7 @@ concurrency: jobs: link-check: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 60 env: PORT: 4000 BASE_URL: http://localhost:4000