ci: verify formatting, types, build, and tests on every PR - #101
Merged
Conversation
WHAT: Add .github/workflows/ci.yml, running on pull_request and on push to trunk: npm ci, npm run check, npm run build, both jest suites, and a guard that package.json and MCP_WORDPRESS_REMOTE_VERSION agree. Concurrency is grouped per PR with cancel-in-progress, permissions are contents: read, and the trigger is pull_request rather than pull_request_target so fork PRs get a read-only token and no secrets. WHY: release.yml was the only workflow and it fires on release, so nothing ever ran on a PR. Every problem found this week traces to that gap: Prettier had drifted across 35 tracked files, `npm run check` had never once executed, a bare tsc in that script was silently overwriting the tsup bundle, and two dependabot PRs were merged reporting "no checks". A local pre-commit hook cannot close this - dependabot commits are created server-side and never run local git hooks. The version guard is included because AGENTS.md states the rule and a check can enforce it; the drift has shipped a token directory named wordpress-remote-undefined once already.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
.github/workflows/ci.yml. Until nowrelease.ymlwas the only workflow and it fires onrelease: published, so nothing has ever run on a pull request.Why this is the gap that matters
Every problem found this week traces back to it:
npm run checkhad never once been executed — a baretscin it was silently overwriting the tsup bundle with per-file output (fix(tooling): stop npm run check from overwriting the build #98)npx jest tests/unit/was labelled "run all tests" while skipping three integration suitesno checks reportedA pre-commit hook cannot close this. Dependabot commits are created server-side by GitHub and never execute local git hooks, and any contributor can pass
--no-verify. CI is the only enforcement that covers bots and strangers.What runs
npm ci→npm run check→npm run build→ both jest suites → version-constant guard.The version guard is the one addition beyond "check + tests".
AGENTS.mdstates the rule thatpackage.jsonandMCP_WORDPRESS_REMOTE_VERSIONmust move together; drift has already shipped a token directory namedwordpress-remote-undefined. A rule a check can enforce belongs in the check. Happy to drop it if you would rather keep this PR to exactly formatting/types/build/tests.Security posture
pull_request, notpull_request_target— fork PRs get a read-only token and no secretspermissions: contents: readgithub.event.*value is interpolated into anyrun:block; the only expression is a concurrency group name, which is never shell-evaluatedVerified locally
Every step was run on this branch before pushing:
checkpasses,buildpasses, 15 suites / 225 tests pass. The version guard was tested in both directions — it passes on matching versions and correctly fails on a simulated0.4.0vs9.9.9drift.This does not block merging on its own
The
protect trunkruleset currently hasdeletion,non_fast_forward, andpull_requestwithrequired_approving_review_count: 0. There is norequired_status_checksrule, so this workflow will report but not gate.Making it blocking is a separate ruleset change, and it has to happen after this merges — adding a required check named
verifywhile no workflow produces it would leave every PR waiting forever on a check that never runs.