Skip to content

fix(search): nobody types the sigil, so lastSeg should not require it #109

fix(search): nobody types the sigil, so lastSeg should not require it

fix(search): nobody types the sigil, so lastSeg should not require it #109

Workflow file for this run

name: Checks
# Runs `npm test` — redirects, page dates, broken links, sitemap — on every push
# and pull request.
#
# Until now these ran only in .githooks/pre-commit, which is bypassable with
# --no-verify and, more to the point, never runs at all for a commit made through
# the GitHub UI or by the sync-cli-guide bot. Three separate regressions shipped to
# production that this would have caught:
#
# * ~90 dead /api/ redirect rules — Cloudflare Pages silently drops _redirects
# rules past the 100th, so the current major's URLs hard-404ed
# * six /api/<pkg>/<seg>/<pkg>/ URLs left 404ing when the duplicate package page
# was removed, while still indexable and listed in the sitemap
# * a stale pageDates.json, which decides whether docs pages carry a real
# publication date or none at all
#
# Nothing here talks to the network or the deployed site, so it is safe to run on
# pull requests from forks.
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
# A superseded run tells you nothing; only the tip of a branch matters.
concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
# REQUIRED: scripts/gen-page-dates.js --check reads git history
# (`git log --follow --diff-filter=A`) to verify every page's recorded
# publication date. The default shallow fetch has one commit, so every
# file would appear to have been added by it and the check would fail on
# every run.
fetch-depth: 0
- uses: actions/setup-node@v7
with:
# 22 in all five workflows and in .nvmrc, which is the point: .nvmrc
# exists so a local shell runs what CI runs, and it said 20 while every
# workflow said 22 — so `nvm use` was arranging to reproduce bugs on a
# version nothing tested. Change all six together or not at all.
node-version: 22
cache: npm
- run: npm ci
# check:links builds both editions itself, and check:sitemap then reads that
# output, so the ordering inside `npm test` already covers the build.
- name: npm test (redirects, dates, links, sitemap)
run: npm test