Skip to content

ci: verify formatting, types, build, and tests on every PR - #101

Merged
galatanovidiu merged 1 commit into
trunkfrom
ci/pr-checks
Jul 27, 2026
Merged

ci: verify formatting, types, build, and tests on every PR#101
galatanovidiu merged 1 commit into
trunkfrom
ci/pr-checks

Conversation

@galatanovidiu

Copy link
Copy Markdown
Contributor

Adds .github/workflows/ci.yml. Until now release.yml was the only workflow and it fires on release: 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:

A 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 cinpm run checknpm run build → both jest suites → version-constant guard.

The version guard is the one addition beyond "check + tests". AGENTS.md states the rule that package.json and MCP_WORDPRESS_REMOTE_VERSION must move together; drift has already shipped a token directory named wordpress-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, not pull_request_target — fork PRs get a read-only token and no secrets
  • permissions: contents: read
  • No github.event.* value is interpolated into any run: block; the only expression is a concurrency group name, which is never shell-evaluated

Verified locally

Every step was run on this branch before pushing: check passes, build passes, 15 suites / 225 tests pass. The version guard was tested in both directions — it passes on matching versions and correctly fails on a simulated 0.4.0 vs 9.9.9 drift.

This does not block merging on its own

The protect trunk ruleset currently has deletion, non_fast_forward, and pull_request with required_approving_review_count: 0. There is no required_status_checks rule, 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 verify while no workflow produces it would leave every PR waiting forever on a check that never runs.

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.
@galatanovidiu
galatanovidiu merged commit f9a1ebd into trunk Jul 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant