Skip to content

content(accessibility): add Forced colours mode page #82

content(accessibility): add Forced colours mode page

content(accessibility): add Forced colours mode page #82

Workflow file for this run

name: Links
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 6 * * *" # Daily at 06:00 UTC — catches rotted external links
workflow_dispatch: # manual trigger for the external-link sweep
permissions:
contents: read
jobs:
# Blocking: broken internal links are a content bug we can always fix.
# Crawls the built site served locally so directory URLs (/spec/x/) resolve
# to their index.html exactly as in production. External links are skipped.
internal:
name: Internal links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
env:
NODE_ENV: production
- name: Check internal links
run: |
npx astro preview --port 4321 &
up=
for i in $(seq 1 30); do
curl -sf http://localhost:4321/ >/dev/null && { up=1; break; }
sleep 1
done
[ -n "$up" ] || { echo "::error::preview server did not start"; exit 1; }
npx --yes linkinator@6 http://localhost:4321 \
--recurse --skip "^https?://(?!localhost)"
# Blocking: runs daily and on demand. A failed run signals rotted external
# links that need fixing. Kept off PRs so a flaky upstream (IETF / W3C / MDN
# rate-limiting, upstream outages) can't block merges — only the daily sweep.
external:
name: External links
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
env:
NODE_ENV: production
- name: Check all links (internal + external)
run: |
npx astro preview --port 4321 &
up=
for i in $(seq 1 30); do
curl -sf http://localhost:4321/ >/dev/null && { up=1; break; }
sleep 1
done
[ -n "$up" ] || { echo "::error::preview server did not start"; exit 1; }
npx --yes linkinator@6 http://localhost:4321 \
--config linkinator.config.json