The checks¶
.github/workflows/check.yml runs on every ready pull request into main and on main itself
every night; a push to main runs only the version check, and a draft runs nothing
(#870). The workflow file explains each step in
its comments; this page says what each job protects. Every action is pinned to a commit SHA.
check.yml runs one Linux job per run, on the self-hosted runner on vps, which costs no
Actions minutes (runner.md, #994).
Its job container has no docker, so the servers' image checks skip there and run in
server-images.yml on ubuntu-latest instead (below):
| Run | Job | What runs |
|---|---|---|
| a draft pull request | none | nothing: the local pre-push gate has checked each push, and a draft cannot merge; the skipped job reports under its name's expression, not as validate (below) |
| a ready pull request: marked ready, and every push after that | validate, the required check |
every step below; the plugin tests the change can have broken, the version check, Semgrep over the changed files, TruffleHog over the pull request's own commits |
a push to main that changes a file under plugins/ |
version |
the version check of the commits the push brought; a push that changes no plugin runs nothing |
nightly on main (03:23 UTC) |
validate |
every step but the version check, with the whole test suite and Semgrep over the whole tree; on Sundays also TruffleHog over the whole history |
by hand (workflow_dispatch), on main or any branch |
validate |
the nightly run with the history scan |
With the runner offline every job waits in the queue; there is no fallback to ubuntu-latest
(runner.md). A red nightly run, like a red push run, is the
coordinator's main_red (below). No workflow runs on Windows
(below).
| Step | Checks | Protects against |
|---|---|---|
| validate the manifests | claude plugin validate --strict for the marketplace and every plugin; no machine-specific path under plugins/ |
a manifest field the runtime silently ignores; a plugin that only works on its author's machine |
| parse and lint | every .ps1 parses; the pre-commit linters and formatters (stacks/claude.md) |
unformatted code, a script that does not parse |
| plugin checks | scripts/ci/check-plugins.sh, below: the bash, Python and Pester tests, all on Linux with pwsh; on a pull request only the tests it can have broken (below) |
a broken script or skill helper |
| version check | on a pull request: every changed plugin has a version greater than on current main; on a push to main, the version job: each commit of the push against its first parent, --push <before> <after> (scripts/ci/check-version-bump.sh) |
a change that merges, looks released and never reaches a machine (authoring/plugins.md); on main, two pull requests that raised a plugin to the same version (below) |
| SAST | Semgrep's default ruleset at severity ERROR over the files a pull request changes, in the nightly run over the whole tree (scripts/ci/semgrep-push.sh, the pre-push hook's script; ADR 0002 (docs/adr/0002-sast-and-secret-scanning.md)) |
a shell built from user input, SQL built by concatenation, a credential in code: a security bug merged and found by Aikido's scan days later |
| Vale | the prose linter over docs/ and README.md, at the pinned version, its archive checked against the SHA-256 in check.yml (below) |
a docs page that breaks the style guide's hard rules |
| secret scan | TruffleHog over a pull request's commits, from its merge-base with main to its head; over the whole history on Sundays and by hand (#870). The pinned binary, its archive checked against the SHA-256 in check.yml, not the TruffleHog action: the action runs in docker, which the self-hosted runner's job does not have |
a token that got past the commit hook; a token committed last week and deleted since |
The version check, the SAST step, Vale and the secret scan run even when a step before them failed, so one push reports every problem.
Drafts¶
A draft's push starts check, and pages when it changes the site's inputs, but their jobs skip
it; the first run comes with ready_for_review, when the pull request is marked ready. GitHub
counts a skipped job as a passed required check, so the job's name is an expression: a run evaluates
it to validate, while a skipped job reports the expression's text,
github.event.pull_request.draft && …, unevaluated. The required validate stays missing, which
blocks the merge, until a ready pull request's run reports it: no head merges on a draft's skipped
run, neither in the seconds before the ready run starts nor when it never starts.
git-flow:babysit-pr reads a draft whose checks all skipped as green_draft with checks_skipped
and marks it ready; the checks then run. A ready pull request whose checks still all skipped five
minutes later stops with stop_needs_user, never green. claude-review and Copilot skip drafts as
well (copilot-review.md).
check-plugins.sh runs locally too, from the repository root, and the pre-push hook runs it with
a pull request's selection of tests (below). It checks:
- no plugin names a specific project (SPEC.md REQ-6);
- every
plugins/*/tests/*-test.shandscripts/tests/*-test.sh, and everyservers/*/test.sh, which runs a server's tests in its own venv with its pinned dependencies (Linux only); - every
test_*.pyunderplugins/and.claude/skills/; - every
*.Tests.ps1under Pester; - the link check,
scripts/ci/check-links.py: every relative link in a tracked Markdown file resolves to a file or folder in the repository, and an anchor into a Markdown file matches one of its headings. Links in code blocks and code spans, URLs, and the recorded eval fixtures underplugins/*/evals/*/resources/are skipped. A page that moves takes every link to it along in the same change, the paths named in files underplugins/included; - the CODEOWNERS check,
scripts/ci/check-codeowners.py:.github/CODEOWNERSowns exactly the pathscoordinator merge-kindgives the owner (codeowners.md); - the bootstrap gist check,
scripts/ci/check-bootstrap-gist.sh(#913), offline:scripts/linux/bootstrap.gistrecords the SHA-256 ofscripts/linux/bootstrap.shas published, anddocs/setup/linux-host.mdcarries the command that record gives. A change to the script withoutbash scripts/linux/publish-bootstrap.shfails here, because a new host would fetch the old revision (linux-host.md).
Merging behind main¶
main does not require branches to be up to date before merging
(#735): a pull request that is green merges behind
main, without merging main in and running every check again. Merging main in is due only when
it has a conflict, or when the commits of main since its merge-base change a plugin or file the
pull request also changes: git-flow's pr-watch then says merge_base, and after each merge
coordinator announce names those pull requests (overlaps, rebumps) and turns their
auto-merge off until they are green again.
What can still reach main is the version clash of #99:
a pull request green against an older main raised a plugin to the version another one took
first. The version check on the push to main fails it, the coordinator's status reports
main_red, and a follow-up raises the version. A run on main is never cancelled by the next
push (cancel-in-progress is for pull requests only), since each run checks only the commits of
its own push.
Two pull requests can also be green each on its own and break a test together. The push to
main no longer runs the tests (#870); the nightly run does, and a red nightly run is main_red
too, until the next nightly run, or a run by hand on main, is green: gh workflow run check
--ref main shows a fix sooner than the next night.
Which plugin tests run where¶
The checks that are not tests (project names, links, CODEOWNERS) always run in full. The tests:
| Where | Tests run |
|---|---|
validate on a pull request |
the wide selection of scripts/ci/check-changed-tests.sh --wide --list origin/<base>, run through check-plugins.sh --changed-since origin/<base>: the narrow selection (every test the branch adds or changes, every test in the folder of a changed script, every test that names a changed script's file name), plus every test of a plugin, server or .claude/skills folder in which any file changed (a test reads hooks.json, SKILL.md, fixtures, not only scripts) |
validate nightly on main and by hand |
all of them (a push to main runs no tests, #870) |
the selection says all (a change to .gitattributes, check.yml, check-plugins.sh, check-changed-tests.sh, run-pester.ps1, .pre-commit-config.yaml or .claude/dev-doctor.json) |
all of them |
the selection cannot be computed (no base, a git error, git ls-files failing) |
all of them: --list prints all and says why on stderr, it never selects none; --run refuses a list entry that is not a tracked file of the repository |
the pre-push hook (scripts/ci/plugin-checks-push.sh), also run by hand as pre-commit run --all-files --hook-stage pre-push |
validate's pull request selection against origin/main as the clone knows it (the hook does not fetch), through the same check-plugins.sh --changed-since; all of them on a push to main, with main checked out, on a push of a ref that is not the checked-out commit, and whenever the selection is all or cannot be computed (#759) |
bash scripts/ci/check-plugins.sh by hand |
all of them |
A pull request that changes only docs runs no plugin test and every other check.
What the selection can still miss: a test that reads a file outside its own plugin, server or
skill folder (a doc, a root config other than the ones above). Such a break shows in the nightly run
on main, which runs everything on Linux. When one turns up, name the file
in the test or add it to the run-everything list in check-changed-tests.sh.
The saving is large: about 7 of the 10 minutes of a full validate run are the tests
(cost.md).
Before the push¶
The pre-push hook runs the plugin checks above, with the tests a branch can have broken
(above), Vale over the docs (below), and two security
scans of the commits being pushed, so a finding stops on the machine, before it is on GitHub
(ADR 0002 (docs/adr/0002-sast-and-secret-scanning.md)):
| Hook | Checks | Protects against |
|---|---|---|
semgrep-push |
scripts/ci/semgrep-push.sh: Semgrep's default ruleset at severity ERROR over the files the pushed commits add or change, as the pushed head has them (not the checkout), printed as file, line, rule and message, never the matched code |
the same as CI's SAST step, a push earlier |
gitleaks-push |
scripts/ci/gitleaks-push.sh: Gitleaks over the pushed commits themselves, also commits made by hand, values redacted; .gitleaks.toml lists the allowed matches with their reasons |
a secret that is on GitHub by the time TruffleHog sees it |
vale-push |
scripts/ci/vale-push.sh: vale docs README.md, when a push changes a page, .vale.ini, .vale/ or the pin (below) |
the same as CI's Vale step, a push earlier |
The two security tools are pinned in .claude/dev-doctor.json (tools); dev-env:dev-doctor installs them at
that version on Linux and Windows, and a hook whose tool is missing fails the push with the
install line rather than skipping. pre-commit run --all-files --hook-stage pre-push runs both
over the whole tree, which stays green: the findings of the first full scan are excluded with a
reason each (.semgrepignore, .gitleaks.toml, inline comments). A push of about one changed
file takes the two hooks 7 to 15 seconds together, most of it Semgrep's start-up and ruleset
fetch.
A false positive is never a switched-off check. Fix the code first; when the rule is wrong for that line, say why next to it:
- Semgrep:
# nosemgrep: <rule id> -- <reason>on the line (the rule id is in the hook's output), or a path in.semgrepignorewith a comment for a whole folder of fixtures. - Gitleaks:
# gitleaks:allow -- <reason>on the line, or an[allowlist]entry in.gitleaks.tomlwith its reason.
A WARNING-level Semgrep finding does not block; it is what workflow:ready's reviews and the
Aikido scan are for. A real secret is rotated and removed from the commits before the push
(git-flow:commit), never allowlisted.
.github/rulesets/main.json records the intended ruleset for main: validate required, a code
owner's review (codeowners.md) and squash merges only. The live ruleset
differs in three settings (codeowners.md). The AI reviews are advice,
not checks: copilot-review.md, claude-review.md.
Vale¶
Vale checks the prose of docs/ and README.md against the
Google developer documentation style guide
(ADR 0008 (docs/adr/0008-docs-style-guide-and-vale.md); the writing rules themselves:
writing-docs.md). The command is vale docs README.md, run
through scripts/ci/vale-push.sh in the hook, in CI and in the Docs checks of CLAUDE.md.
- What runs.
.vale.ininames the styles: Vale's own andGoogle. The Google package is committed under.vale/styles/Google/at release v0.7.1, with its MIT licence, and never synced from the network. A rule that clashes with this repository's rules is switched off in.vale.iniwith its reason, never on a line of a page. The voice rules are one example:writing-docs.mdsets the voice, not Google. - Errors fail, warnings report. An error fails the hook and CI. A warning is printed and
fails nothing;
workflow:docslists warnings in its reviews. - Exempt paths of
writing-docs.mdare excluded in.vale.ini, so Vale reports nothing there. - Words Vale does not know. A product, a command or a name that the spelling check flags goes
into
.vale/styles/config/vocabularies/Repo/accept.txt, under the comment of its group. An entry is a regular expression;(?i)makes it ignore case. - The pin.
.claude/dev-doctor.jsonpins the version (tools.vale), anddev-env:dev-doctorinstalls it into~/.local/binon Linux and Windows. CI downloads the same release and checks it against the SHA-256 written intocheck.yml. A new pin changes both lines in the same pull request.
Temp files¶
The gate's scripts write no temp file to the system temp folder (#835): on Windows that is on
C: and scanned by the virus scanners at every file a test writes, which costs most of a gate
run's CPU there. check-plugins.sh, check-changed-tests.sh --run, the two
security hooks, docs-site-gate.sh and docs-public-check.sh source scripts/ci/build-tmp.sh
first, which
- points
TMPDIR,TMPandTEMPat a folder per run,<checkout>/build/tmp/run-<id>(mode 700, a setgid bit inherited from a worktree base cleared, #887), somktemp, Python'stempfileand Pester'sTestDriveland there unchanged; a script started by one that already entered uses that folder; - removes the folder at the end of the run, and at the start every
run-*folder older than 24 hours, the leftovers of killed runs; - sets
GIT_CEILING_DIRECTORIESto<checkout>/build, so git started in a temp folder does not find the checkout around it. Code that looks for.gititself honours the ceiling as git does (vault-export.ps1); - names the system temp folder in
BUILD_TMP_SYSTEM_TEMP, for a test that needs a folder outside the checkout (Sandboxes.Tests.ps1: setup refuses a token helper where a sandbox can mount it;sandboxes-test.shandsandbox-provision-test.sh, whose fixtures name/srv/worktreesas a workspace).
/build/ is git-ignored and skipped by Semgrep (.semgrepignore). Gitleaks skips build/tmp
in its working-tree scan only (.gitleaks-worktree.toml, which extends .gitleaks.toml;
gitleaks dir does not honour .gitignore): a file force-added from there is scanned in the
pushed commits like any other. A test started on its own keeps the system temp
folder. Out of scope: the temp files of pre-commit itself and its third-party hooks (ruff,
shfmt, shellcheck), and the workflows' own $RUNNER_TEMP.
Windows¶
No CI job runs on Windows (cost.md). Windows
is supported only as the owner's workstation, which runs Claude Desktop and the coordinator CLI;
workers and sandboxes run on Linux, so nothing is pushed from Windows. PowerShell scripts are
written for pwsh 7 and run on Linux too, so validate tests them there. The Windows branches
of dev-doctor.ps1, of the coordinator CLI and of scripts/windows/ stay and go untested in
CI, as do jq.exe and Git for Windows' line endings in Git Bash, which only Windows can show
(#114, #117, #147).
The workstation pushes nothing, so its pre-push hook does not run; running the gate in Git Bash
(scripts/ci/plugin-checks-push.sh, or bash scripts/ci/check-plugins.sh for a full run) is
unsupported, and a failure there that Linux does not show is no finding against a pull request.
When the Windows machine still pushed, its hook caught Windows-only failures, late: after the change that caused them had merged (#94, #147, #243, #284, #316). The causes so far:
- a file name with
:, which NTFS reads as an alternate data stream; - a child process's output read with the locale's encoding (cp1252) while a
PYTHONIOENCODINGin the hook's environment made the child write UTF-8; - file modes, which NTFS only emulates (
statnever shows600); - tests of Linux-only scripts (
pgrep, symlinks).
The Windows code stays, so tests keep the rules that let them run there: a test that runs a script
and reads its text passes encoding="utf-8" to subprocess.run and sets PYTHONIOENCODING=utf-8
for the child. A case that cannot hold on Windows is skipped there (uname -s matching
MINGW*|MSYS*|CYGWIN*) with one comment line saying why.
The docs site¶
.github/workflows/pages.yml publishes docs/ as the public website https://claude.lauper.net
on GitHub Pages (ADR 0006 (docs/adr/0006-public-docs-site.md)). The repository stays private;
every page the site publishes is readable by anyone, so it runs behind a gate.
- When: a push to
mainthat changes the site's inputs, and by hand (Actions → pages → Run workflow). A pull request that changes them runs the same steps without the deploy, so a finding shows before the merge. A change toplugins/starts a run only when it touches aplugins/*/README.md. The inputs are:docs/,README.mdandplugins/*/README.md;mkdocs.yml, the workflow and the action.github/actions/docs-site/;.github/docs-public-allow.txt;- the tool pins (
.claude/dev-doctor.json,scripts/ci/pinned-tool.sh); - the
scripts/ci/docs*files.
- What is published: the list under
exclude_docsinmkdocs.yml, and nothing else. It excludes everything, then lets each public folder and file back in with a!/<name>line; a new folder stays private until a reviewed pull request adds its line.adr/,plans/andspecs/are not listed, nor isreferences.mduntil the owner has reviewed its licence paragraph. One more form is accepted: an anchored/<nested path>without a wildcard, such as/mockups/x/README.md, excludes that path inside a listed folder—for a file that is no page for readers: aREADME.mdbeside a staticindex.html, which MkDocs would both build asindex.html(#729), or/architecture/CLAUDE.md, the architecture description's writing rules (#882). The site check verifies that such a path is absent from the site, and refuses every other form: a nested re-inclusion!/a/b/, a wildcard, an unanchored line. A forgotten line is still caught: the site check fails on any page built from aCLAUDE.md,AGENTS.mdor_template.md(#757), and MkDocs' warning about aREADME.mdbeside a staticindex.htmlfails the strict build. - The home page is the repository's
README.mdfollowed bydocs/index.md, as one page with the title "Overview" (scripts/ci/docs_home_hook.py, #880): the navigation entry, the page's one heading and its meta title, so the browser tab reads "Overview - Claude Code setup". Neither file changes: the hook replaces the README's# claudeheading at build time, and the README'sdocs/…links become links to the site's pages; its other links into the repository follow the next point. The site check verifies the one<h1>, that it is "Overview", and the order, found by the README's first##heading coming before the first one ofdocs/index.md; the gate scans the README like every page. - The plugin pages: each
plugins/<name>/README.mdis added at build time as the pageplugins/<name>.md(scripts/ci/docs_plugins_hook.py, #709), listed after the Plugins index in the order of its table. Only the README of a plugin folder is read; a folder without one gets no page. A link to another plugin's README or intodocs/becomes a site link, any other link a path in code style. The gate scans these pages like every other; a finding is fixed in the README, or allowlisted with its reason when it is a false positive. - Links that leave the site—into
plugins/,scripts/,servers/, the README or a privatedocs/folder—are rendered as the target's path in code style (scripts/ci/docs_links_hook.py, an MkDocs hook). The Markdown stays unchanged, so the links still work on GitHub. - Links to a published folder (
../setup/), which GitHub shows by its README, point at the folder'sREADME.md,index.mdor staticindex.htmlon the site; a published folder with none of them becomes its path in code style, as a private one does (#729). - The owner's login is shown as
<owner>on every page, code blocks included (scripts/ci/docs_mask_owner_hook.py, an MkDocs hook that runs last, #712):<owner>/<repo>,@<owner>,<plugin>@<owner>and the marketplace's name. A link whose target names the login becomes its text, as it is a dead end for a public reader; when that text starts the line, a#,>, list marker or underline it begins with is escaped, so#385: it mergedstays a sentence and is no heading (#730). Only whole words are masked. The login comes fromDOCS_OWNER_LOGIN, which the workflow sets togithub.repository_owner; the build stops when it is unset. The sources keep the login, as the Identities rule inCLAUDE.mdrequires. - The footer names how the pages are made: written with Claude Code, style checked by Vale
against Google's developer documentation style guide, built with MkDocs and Material for MkDocs
(
scripts/ci/docs_footer_hook.py, #976). It setscopyright, which Material prints as HTML, so the five links are<a href>elements and all external, and switches off Material's own "Made with" notice, so the line names MkDocs and Material once. It comes from the action, so every site built with it shows the same line. A config that sets its owncopyrightkeeps it, and keeps Material's notice too.
The build, the site check, the gate selftest and the gate are one composite action,
.github/actions/docs-site/ (#757), which other repositories run too
(The docs site action); pages.yml runs it from the same commit, with
readme-home and mask-owner on. The steps, in order; any failure stops the run before the
deploy:
| Step | Checks | Protects against |
|---|---|---|
| Markdown lint | scripts/ci/docs-markdown-lint.py, also a pre-commit hook: on every published page, a list or table needs a blank line before it, everything inside a list item is indented by 4 spaces per level, an item after a second paragraph or code block of the item before needs a blank line, and no line or list item starts with # and no space |
a list GitHub shows and the site renders as one paragraph, flat, or restarted at 1 (#710); a wrapped #46) were … that the site shows as a heading (#730) |
| build | scripts/ci/docs-site-build.py: mkdocs build --strict with the versions of scripts/ci/docs-requirements.txt, running the shared hooks from the action, also those mkdocs.yml lists (here it lists them all) |
a link to a page that does not exist |
| site check | scripts/ci/docs-site-check.py --readme-home site: every listed folder is in the site, no unlisted one is, no path a nested exclude_docs line excludes is, no page is built from a CLAUDE.md, AGENTS.md or _template.md, the theme's assets/stylesheets/ and assets/javascripts/ hold files, no <a href> leaves the site or points at the repository's files, the home page is as described above, and no other page has more than one <h1> |
a private folder published by a pattern that matched more than intended; instructions for writers published by a forgotten exclusion (#757); a site without the theme's CSS and JavaScript (#699); a dead link into the private repository; a heading the source does not have (#730) |
| gate selftest | scripts/ci/docs-site-gate-selftest.sh: the gate fails on a fixture page with a GitHub token, and on one with a password split by code highlighting, both drawn at random for the run (the password is drawn again until gitleaks reports it in a plain assignment: its generic-api-key rule skips a value that holds a stopword, #869), never committed, and prints no part of either |
a gate that passes because a tool did not run, or because highlighting hid a value |
| rules selftest | scripts/ci/docs-site-rules-selftest.sh, only for a caller that sets the action's rules-selftest input (#966; this repository has no rules file of its own): each fixture page of the caller's folder must make docs-public-check.sh fail on the rule its folder names |
a typo in a rule of the caller's rules file that lets a page through |
| gate | scripts/ci/docs-site-gate.sh site: gitleaks dir with its default rules, without .gitleaks.toml's repository paths (the version .claude/dev-doctor.json pins), over the site and over its page text (tags removed, entities decoded; a finding there names the page with (text)), TruffleHog filesystem with --results=verified,unknown (the version the action pins) over the site, and scripts/ci/docs-public-check.sh |
a secret, or a private detail that is no secret, on a public page |
| hook and build tests | scripts/tests/docs-links-hook-test.sh, docs-public-check-test.sh and docs-site-build-test.sh with the MkDocs the action installed (a skip fails here): links to published folders, the plugin and home pages, and a scratch consumer built, checked and gated as another repository does |
a folder link that is dead on the site; an action that works only in this repository |
| deploy | main only: upload-pages-artifact and deploy-pages |
— |
docs-public-check.sh fails on an email address that is not allowlisted, an address in a private
range (RFC 1918) or the tailnet's shared range (RFC 6598), a host name under ts.net, .local,
.lan, .internal or .home.arpa, a phone number (+<country> … and the Swiss 0xx xxx xx xx),
a term of DOCS_PRIVATE_TERMS or DOCS_INTERNAL_HOSTS, the bot account's login, and the owner's
login. The site carries no email address or personal data of anyone, no internal address or
information, and no login of the owner (#712). Loopback, public addresses, the bare word ts.net,
placeholders such as <owner email> and the repository's own URLs pass.
The owner's login is read from DOCS_OWNER_LOGIN, set by the workflow. The hook above masks it, so
a finding here is a form the hook missed. A repository that does not mask the login sets
DOCS_OWNER_RULE=off (the action's mask-owner: false does): the rule is not run, and the login
may be unset. The check reads:
- every file of the site;
- the text of every page with its tags removed and its entities decoded, so a value that code
highlighting splits into
<span>s is caught too. Inline elements (span,a,code,em) stay joined; every block-level boundary (p,div,li,br,h1–h6,td,pre, …) breaks the line, so the words of two blocks never become one; - the path of every file and folder of the site, relative to the site folder (#729), so a folder
named after a person or an internal host fails as well. Such a finding names the path with
(path).
Every finding is printed as file, line and rule, never the value; a file or folder name that holds
a finding is printed as *** in every path of the output. Run it locally with
CLAUDE_BOT_LOGIN=… DOCS_OWNER_LOGIN=… DOCS_PRIVATE_TERMS=… DOCS_INTERNAL_HOSTS=… bash scripts/ci/docs-site-gate.sh site [<allowlist> [<rules file>]] after mkdocs build; its tests
are scripts/tests/docs-public-check-test.sh, scripts/tests/docs-site-check-test.sh,
scripts/tests/docs-site-gate-test.sh, scripts/tests/docs-site-build-test.sh,
scripts/tests/docs-links-hook-test.sh and scripts/tests/docs-mask-owner-hook-test.sh.
A repository's own rules. Another repository runs the gate through the action and keeps its
own rules in .github/docs-public-rules.sh (#729), the action's rules-file input.
docs-public-check.sh sources that file when it exists, after the shared rules, relative to the
directory it runs in; without it the shared rules alone apply. This repository has none.
The file is bash and calls the two functions the check defines:
rule <name> <message> <filter> <grep flags> -e <pattern>(or-f <pattern file>): one finding per match, with the filterany,private_iporphone_digits;terms <name> <variable> <what>: each line of the environment variable<variable>as a whole word in any case, named by its number in the list.
It reads its inputs from the environment, never from a file in the repository, and ends the check
with exit 2 when one is missing. A rules file that cannot be read, does not parse or returns
non-zero, and a rule called with the wrong arguments, fail the gate with exit 2. For example:
# Google Cloud names that are not public
rule run-app "a Cloud Run host name" any -iE -e '[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.run\.app\b'
[ -n "${DOCS_GCP_PROJECT:-}" ] || { echo "::error::DOCS_GCP_PROJECT is not set" >&2; exit 2; }
terms gcp-project DOCS_GCP_PROJECT "the Google Cloud project id: term"
What the site must not name comes from the repository (Settings → Secrets and variables → Actions), one term per line, matched as a whole word in any case; the gate fails while one is unset:
| Name | Kind | Holds |
|---|---|---|
CLAUDE_BOT_LOGIN |
variable | the bot account's login. Its own name, because CLAUDE_GITHUB_LOGIN means "the login gh acts as" and differs per machine |
DOCS_PRIVATE_TERMS |
secret | personal data: the owner's and other people's names, personal email addresses, phone numbers, street addresses. A secret, because the list is personal data itself; a finding names the term by its number in the list, never the term |
DOCS_INTERNAL_HOSTS |
variable | internal information: the machines' host names, internal service names and subdomains that are not public |
A finding in a published page is fixed in the source: the value becomes a placeholder such as
<owner email>, <host> or <internal service> in a code span, or the page leaves the list in
mkdocs.yml.
A false positive on the site is fixed in the page first. When the value is right to publish, allowlist it with its reason:
docs-public-check.sh: a<rule> <value>line (email,iporhost) in.github/docs-public-allow.txt, with a# <reason>line above it; an entry without one fails the check.- A third-party folder the email rule must not read, such as the theme's vendored JavaScript with
its authors' licence-header addresses: a
skip-email <site folder>/line in the same file, with its reason. It skips the email rule only; the other rules still read the folder. - gitleaks:
gitleaks:allowon the line, with the reason; a path in.gitleaks.tomldoes not apply to the site. - TruffleHog reports only verified or unknown results. The gate passes it no exclude list
(
.github/trufflehog-exclude.txtholds repository paths, not site paths): a finding there is fixed in the page.
A real secret or a person's address is never allowlisted: it comes off the page, and a secret is
rotated. The build job runs on the self-hosted runner on vps (runner.md); only the
deploy on main, a job of its own, runs on ubuntu-latest, about one billable minute from the
monthly quota (cost.md).
The docs site action¶
Another repository builds and gates its own docs site with this repository's scripts through the
composite action .github/actions/docs-site/ (#757), instead of copying them. It runs the build,
the site check, the gate selftest and the gate of the table above; upload and deploy stay in the
caller's workflow, with its own Pages permissions, environment and concurrency. The shared hooks
come with it: the build adds docs_links_hook.py and docs_footer_hook.py, and with their inputs docs_home_hook.py and
docs_mask_owner_hook.py, when the caller's mkdocs.yml does not list them
(scripts/ci/docs-site-build.py). A hook the config lists by one of those file names, an old
copy say, is replaced by the shared one at its place, so a caller never runs a stale copy; a fork
needs a file name of its own. This repository's mkdocs.yml lists all four, so that a plain
mkdocs build works here, and its build takes the same path as every caller's.
Use it in the caller's pages.yml, pinned by commit with the release tag in a comment, as
every action there is:
- uses: actions/checkout@<sha> # v7.0.1
with:
persist-credentials: false
- id: docs
uses: <owner>/claude/.github/actions/docs-site@<sha> # docs-site/v1.0.0
with:
rules-file: .github/docs-public-rules.sh
bot-login: ${{ vars.CLAUDE_BOT_LOGIN }}
private-terms: ${{ secrets.DOCS_PRIVATE_TERMS }}
internal-hosts: ${{ vars.DOCS_INTERNAL_HOSTS }}
env:
# an input of the caller's rules file, read from the environment
DOCS_GCP_PROJECT: ${{ vars.DOCS_GCP_PROJECT }}
- uses: actions/upload-pages-artifact@<sha> # v5.0.0
with:
path: ${{ steps.docs.outputs.site-dir }}
The inputs, with their defaults, are in action.yml and in the release notes
(.github/actions/docs-site/CHANGELOG.md): the config, the site folder (the config's
site_dir unless set; the output site-dir names it for the upload), the allowlist and the
rules file as paths in the caller's checkout, readme-home and mask-owner (both off: the
caller's home page is its docs/index.md, the owner's login is shown, and the gate's owner rule
is off), and the three values the site must not name. Those three are inputs, never read by the
action on its own: the caller passes its variables and its secret explicitly. A rules file reads
its own inputs from the environment, which the step's env passes on. A caller without a rules
file gets the shared rules only.
Testing a repository's own rules. The gate selftest proves only the shared rules. A repository
that keeps its own rules file sets rules-selftest to a folder of fixture pages, one subfolder
per rule, named as the rule is in the rules file:
.github/docs-public-fixtures/
cloud-run-host/service.html # a made-up Cloud Run host name
gcp-project/project.html # <p>The project @@DOCS_GCP_PROJECT@@ runs it.</p>
The action runs scripts/ci/docs-site-rules-selftest.sh next to the gate selftest, before the
gate runs over the real site. Each page is checked alone, under its own name (a rule can match a page's
name), with the caller's allowlist and rules file, and must make the privacy check fail on the rule its folder names. A page that passes, or
fails on other rules only, fails the action; the output names the page and the rules, never a
value (the value of every variable a page names is masked in each line printed). A caller's rule
may reuse the name of a shared rule such as host: its page then has to produce more findings of
that name than the shared rule alone does, or the shared rule would stand in for a pattern that
matches nothing. A page holds no personal value: it carries the shape a rule matches, made up, and writes a
value the rule reads from the environment as @@NAME@@, which the run fills in from the
environment variable NAME in a scratch copy. An unset variable is an error. Without the input
nothing changes. The script's tests are scripts/tests/docs-site-rules-selftest-test.sh.
Host step: both repositories are private, so the action runs elsewhere only once Settings → Actions → General → Access of this repository allows "Accessible from repositories owned by the user". Only the owner can set it (#931).
New versions reach the caller as Dependabot pull requests, which run the caller's whole build
and gate before they merge. The caller's .github/dependabot.yml covers the action with the
github-actions ecosystem:
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
Releases are tags docs-site/v<MAJOR.MINOR.PATCH>: a fix is a patch, a new input that
defaults to the old behaviour a minor version, a change a caller has to follow a major one. The
slash form is the one Dependabot updates for an action in a subfolder; it groups dash forms such
as docs-site-v1.0.0 wrongly or misses their new versions. A release is made only by
.github/workflows/docs-site-release.yml, run by hand on main
(gh workflow run docs-site-release.yml --ref main -f version=<version>): it refuses a version
without its ## <version> section in the CHANGELOG or with an existing tag, runs the action on
this repository's site and the build, check and gate tests at that commit, and only then creates
the tag and the release with that section as its notes. A tag without a passing self-test is
never published, and a release is never moved.
The dashboard images¶
.github/workflows/dashboard-images.yml builds the dashboard's two images for linux/amd64 and
linux/arm64 (the Pi hub)—ghcr.io/<owner>/dashboard-feed (servers/dashboard/feed/Dockerfile)
and ghcr.io/<owner>/dashboard-sync (servers/dashboard/sync.Dockerfile), #604—and runs only
when servers/dashboard/** or the workflow itself changes:
| Event | Does |
|---|---|
| pull request | builds both images for both platforms, pushes nothing: a Dockerfile that does not build for arm64 shows before the merge |
push to main |
builds and pushes both as sha-<commit> and main with the workflow's GITHUB_TOKEN (packages: write), then keeps the 5 newest sha-* versions of each package and deletes older ones together with their platform manifests |
The hub pulls them with deploy.sh (DASHBOARD_SOURCE=pull, servers/dashboard/README.md,
"Install and update"). The image's tests—the sync image against the MCP stub—run in
servers/dashboard/test.sh, on a pull request in server-images.yml
(below). A superseded pull request run is
cancelled. On main each commit's run has a concurrency group of its own, so no merged commit is
left without its images: one group would hold a single pending run and cancel it for the next
merge. The cleanup is a job of its own with one group, so two cleanups never run at once.
The server images¶
.github/workflows/server-images.yml runs the image checks of servers/*/test.sh on GitHub's
ubuntu-latest, which has docker (#994). The
validate job runs every servers/*/test.sh too, on the self-hosted runner: there a server's
unit tests run and its image check skips with CI_NO_DOCKER's text as the reason
(runner.md).
- When: a ready pull request that changes a file under
servers/or the workflow itself. A pull request that changes no server starts no job here. - What runs: the
test.shof each server with a changed file, every server's when only the workflow changed: the unit tests again, then the image built, started and called. WithCIset andCI_NO_DOCKERunset, atest.shthat finds no docker fails instead of skipping.
A push to main and the nightly run check no server image: each image change reached main
through a pull request that built it here.
Files under .github¶
| File | What it is |
|---|---|
workflows/check.yml |
the jobs above |
workflows/claude-review.yml |
the Claude review on every pull request (claude-review.md) |
workflows/dashboard-images.yml |
the dashboard's images on GHCR (The dashboard images) |
workflows/pages.yml |
the public docs site: build, checks, gate, deploy (The docs site) |
workflows/server-images.yml |
the servers' image checks on a pull request that changes a server (The server images) |
docs-public-allow.txt |
the values the docs site's privacy check lets through, each with its reason (The docs site) |
trufflehog-exclude.txt |
the fixture paths TruffleHog skips, each with its reason |
copilot-instructions.md, instructions/ |
what Copilot code review is told; what it reads and why (copilot-review.md) |
CODEOWNERS |
@<owner> owns the paths whose pull requests the owner merges, the same list as coordinator merge-kind (codeowners.md) |
rulesets/main.json |
the intended branch ruleset for main: pull request (squash merges only, #596), code owner review, the Copilot review rule and the validate check (codeowners.md) |
What the jobs cost in Actions minutes, and what each one has caught so far: cost.md.