Skip to content

Commit 6811fd3

Browse files
Mlaz-codeclaude
andcommitted
ci: broken-link check via linkinator
After pnpm build, stand up a throwaway static server on out/ and crawl every internal link recursively. Any 404/anchor miss fails the workflow. - scripts/check-links.sh: serves out/ via python3 -m http.server, waits for readiness, invokes linkinator. Wrapper exists because linkinator's CLI rejects --server-root when combined with a URL and can't resolve absolute hrefs (/en/api-reference etc.) against a local file path without a server. - package.json: adds linkinator devDep + `check-links` script so devs can run the same check locally with `pnpm check-links`. - deploy-dev.yml + deploy-prod.yml: add Check links step after Build. Verified locally: 65 links scanned, all green. External URLs are skipped — their drift is a third-party concern that would fail CI on transient upstream outages. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b04ee07 commit 6811fd3

5 files changed

Lines changed: 929 additions & 56 deletions

File tree

.github/workflows/deploy-dev.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
- name: Build
4444
run: pnpm build
4545

46+
- name: Check links
47+
run: pnpm check-links
48+
4649
deploy-preview:
4750
name: Deploy Preview
4851
needs: validate

.github/workflows/deploy-prod.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ jobs:
5858
- name: Build
5959
run: pnpm build
6060

61+
- name: Check links
62+
# Spins up a local static server on out/ and crawls every
63+
# internal link with linkinator. Catches dead anchors and
64+
# rotten internal paths before they ship to docs.sharpapi.io.
65+
# External URLs are skipped — their drift is a third-party
66+
# concern and would fail CI on transient upstream outages.
67+
run: pnpm check-links
68+
6169
backup-deployment:
6270
name: Backup Current Deployment
6371
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)