Skip to main content

Add PR checks before code reaches production

The production deploy runs on push to main, and the only workflow triggering on pull_request is a branch/issue check. Nothing validates the code itself before it ships.

A syntax error in a PHP file reaches production and takes the site down. There's no gate.

Fix

Already scoped as issue #114 on the SMPW repo. Wanted:

  • php -l across changed PHP files
  • node --check on JS
  • Run the asset build, so a broken build fails the PR rather than the deploy
  • Branch protection requiring the checks to pass

Scope it to the ~147 project files, not the 10,000+ vendored ones, or it'll be slow and noisy.

PHPCS deliberately left out for now, functions.php alone has over a thousand errors and fixing those is a separate job from stopping broken code shipping.