docs: én tjekliste paa fire trin i stedet for trin spredt over tre sk… #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: docs-gate | |
| # Structural guard for browsermcp.dev (GitHub Pages serves docs/ from main). | |
| # Two steps: | |
| # 1. regen-diff — scripts/generate-docs.py must reproduce the committed HTML | |
| # byte-for-byte. Kills hand-edit drift (sources in content/ are the truth). | |
| # Note: a page whose front-matter publish_date has just passed will fail | |
| # this step on purpose — that is the "content is due, regen + commit" signal. | |
| # 2. check-docs — tool-count vs tools.js, leak markers, internal links, | |
| # canonical/og meta, sitemap coverage (scripts/check-docs.py, stdlib only). | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs/**' | |
| - 'content/**' | |
| - 'scripts/generate-docs.py' | |
| - 'scripts/check-docs.py' | |
| - 'mcp-server/tools.js' | |
| - '.github/workflows/docs-gate.yml' | |
| pull_request: | |
| paths: | |
| - 'docs/**' | |
| - 'content/**' | |
| - 'scripts/generate-docs.py' | |
| - 'scripts/check-docs.py' | |
| - 'mcp-server/tools.js' | |
| - '.github/workflows/docs-gate.yml' | |
| jobs: | |
| gate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: regen-diff (generator output == committed HTML) | |
| run: | | |
| python3 scripts/generate-docs.py | |
| # --porcelain catches BOTH modified tracked files AND untracked new pages; | |
| # `git diff --exit-code` silently ignores untracked files (a new page 404s in prod but passes CI). | |
| if [ -n "$(git status --porcelain -- docs/)" ]; then | |
| echo '::error::docs/ HTML differs from generator output — edit content/*.md and re-run scripts/generate-docs.py (never hand-edit docs/ HTML)' | |
| git status --porcelain -- docs/ | |
| exit 1 | |
| fi | |
| - name: check-docs (tool-count · leaks · links · meta · sitemap) | |
| run: python3 scripts/check-docs.py |