ci: verify pull requests into main - #5
Merged
Conversation
deploy.yml only runs on push to main, so the protect-main ruleset's "Require status checks to pass" had nothing to require — a PR could not be blocked on a red build. Adds a single `verify` job on pull_request: npm ci, check, test:run, build. One job rather than four so the ruleset has one check to require. Steps run cheapest-first so a formatting failure reports in seconds. Does not run on push to main: deploy.yml already covers that path. Unblocked by the preceding .gitattributes commit — before it, a fresh runner checkout failed `check` on line endings alone.
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— a singleverifyjob that runs on every pull request intomain.Why
deploy.ymlonly runson: push: [main], so theprotect-mainruleset's Require status checks to pass rule had nothing to require. A PR could not be blocked on a red build. This gives it something to require.Shape
check→test:run→buildpush: [main]triggerdeploy.ymlalready runstest:run+buildthere; duplicating it wastes minutes.cancel-in-progress: truedeploy.ymldeliberately does the opposite — a half-finished deploy is worse than a slow one.permissions: contents: readNode 22 +
cache: npm, matchingdeploy.yml.Verification
This PR is its own test:
pull_requestworkflows run from the PR branch, so a green verify check here means the file parses and every step passes on a clean runner.Locally on this branch:
npm run checkclean (57 files), 210/210 tests,npm run buildclean.Follow-up (needs you, in GitHub settings)
Once this merges and one PR has reported a green verify, enable Require status checks to pass on the
protect-mainruleset and selectverify. GitHub only offers checks it has seen run at least once.