Files
rcourtman d28666c396 Guard shipped docs mirror sync at commit time
Docs under frontend-modern/public/docs are byte-for-byte copies of repo
docs, but the only guard was a CI vitest the git hooks never run. On
2026-09-01 two commits (f4886c2dfb, f313882a7b) each edited a mirrored
doc without its copy, passed the hooks, and broke main's Frontend job.

Add scripts/check_docs_mirror.py with an index-blob --staged mode wired
into the pre-commit hook: a commit that stages either side of an
out-of-sync pair (or an orphan shipped copy) fails with the exact sync
command, while pre-existing drift from other commits only warns. The
worktree mode runs as a named step in the public-docs workflow, with
unit tests in scripts/tests picked up by the existing runner. The
docsLinks vitest stays as the CI backstop.

Build-time generation of public/docs was considered and rejected: the
shipped set is a curated subset (61 of 421 docs), so generation still
needs a hand-maintained manifest while adding build, dev-server, and
test-order coupling.
2026-09-01 11:16:05 +01:00

47 lines
1.1 KiB
YAML

name: Public docs
on:
pull_request:
paths:
- "*.md"
- "docs/**"
- "frontend-modern/public/docs/**"
- ".github/ISSUE_TEMPLATE/**"
- "scripts/check_public_docs.py"
- "scripts/check_docs_mirror.py"
- ".github/workflows/public-docs.yml"
push:
branches:
- main
paths:
- "*.md"
- "docs/**"
- "frontend-modern/public/docs/**"
- ".github/ISSUE_TEMPLATE/**"
- "scripts/check_public_docs.py"
- "scripts/check_docs_mirror.py"
- ".github/workflows/public-docs.yml"
permissions:
contents: read
concurrency:
group: public-docs-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Validate public documentation
run: python3 scripts/check_public_docs.py
- name: Check shipped docs mirror sync
run: python3 scripts/check_docs_mirror.py