Repository navigation
ci: Pin to Node 22 and tidy the workflows - #250
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Deployment needs an npm version that supports trusted publishing, and beta publishing still does not wait for successful validation.
2 open issues
What changed in this PR
This PR aligns development and CI with Node 22, the package’s supported major-version floor, and updates the workflows on top of the test-runner migration.
Changes:
- Switch
.nvmrcfrom Node 24 to Node 22. - Add Test and Lint runs for pushes to
testing. - Update action versions, enable npm caching in four workflows, and correct the deployment comment.
| File | Description |
|---|---|
.nvmrc |
Select Node 22 for development and CI. |
.github/workflows/test.yml |
Test testing pushes; update actions and enable npm caching. |
.github/workflows/lint.yml |
Lint testing pushes; update actions and enable npm caching. |
.github/workflows/generate-types.yml |
Update checkout and Node setup actions. |
.github/workflows/docs.yml |
Update build/deployment actions and enable npm caching. |
.github/workflows/deploy.yml |
Update actions, enable npm caching, and correct the Node-version comment. |
Review effort: Balanced
RobinBol
force-pushed
the
chore/node-test
branch
from
October 23, 2026 07:32
5b32716 to
7a12860
Compare
RobinBol
force-pushed
the
chore/workflow-hygiene
branch
from
October 23, 2026 07:32
7d008a4 to
fba6486
Compare
The repository supports Node 22 and up, but every workflow ran Node 24 through .nvmrc, so the supported floor was never the version anything was actually checked against. Verified on Node 22.23.4, the current 22.x, at the tip of the open stack: npm ci, 114 tests pass, lint, format:check, the docs build, generate-types with an unchanged index.d.ts, and tsc all succeed. That includes the native type stripping #243 relies on, which needs Node 22.18 or newer; `22` in .nvmrc resolves to the latest 22.x. engines.node stays ">=22": consumers are not restricted to 22, this only fixes what the project itself develops and tests against.
Four unrelated bits of workflow upkeep. Pushes to `testing` ran neither Lint nor Test, while deploy.yml publishes a beta from that same branch. Both workflows now trigger on it. setup-node gets `cache: 'npm'` in the four workflows that lacked it; generate-types.yml already had it. They each re-resolved the whole tree on every run. actions/checkout and actions/setup-node go from v4 to v7, and peaceiris/actions-gh-pages from v3.8.0 to v4. The deploy.yml header still described a Node 12 environment; it has read the version from .nvmrc for a long time.
Two problems the Node 22 pin exposed in deploy.yml. Publishing uses OIDC trusted publishing with --provenance and carries no NPM_AUTH_TOKEN, and that needs npm 11.5.1 or newer. Node 22 bundles npm 10.9.9, and setup-node installs whatever npm ships with the Node version it selects, so both the production and the beta publish would have failed authentication, after the version bump and tags had already been pushed. npm is now upgraded explicitly. npm 11 needs Node >=22.9.0 and `22` in .nvmrc resolves well past that. Adding `testing` to the Lint and Test workflows made the checks run on that branch but did not hold anything back: deploy.yml starts on the same push and neither waits for them nor repeats them, so a `#patch` push could still publish a beta before they finished. The deploy job now runs lint, format:check and the tests itself, before the version bump, so a failure stops the publish instead of racing it.
The docs build is the slowest step in the job and nothing about publishing depends on it, so running lint, format:check and the tests first means a failing check stops the job before that minute is spent. Build and the publish steps that follow are unchanged.
RobinBol
force-pushed
the
chore/node-test
branch
from
October 23, 2026 08:05
7a12860 to
5bd4b42
Compare
RobinBol
force-pushed
the
chore/workflow-hygiene
branch
from
October 23, 2026 08:05
fba6486 to
ae2a43d
Compare
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.


What
Workflow upkeep, stacked on #247. Four commits:
ci: pin development and CI to Node 22-.nvmrc24 -> 22ci: gate the testing branch, cache npm, update the actionsci: keep publishing working on Node 22 and gate it on the checksci: validate before building the docs in the deploy jobWhy
The supported floor was never tested.
engines.nodesays>=22, but.nvmrcsaid 24 and all five workflows read it, so nothing ever ran on the version the package claims to support.enginesstays>=22; this only changes what the project itself develops and tests against.Pushes to
testingran neither Lint nor Test, whiledeploy.ymlpublishes a beta from that branch. Both now trigger on it. Triggers alone hold nothing back, though, so commit 3 runslint,format:checkandtestinside the deploy job, before the version bump, where a failure stops the publish rather than racing it.Pinning to 22 would have broken publishing. Publishing uses OIDC with
--provenanceand carries noNPM_AUTH_TOKEN, which needs npm >= 11.5.1. Node 22 bundles npm 10.9.9, and setup-node installs whatever npm ships with the Node it picks, so both publishes would have failed authentication after the version bump and tags were pushed. Commit 3 upgrades npm explicitly; npm 11.21.1 needs Node^20.17.0 || >=22.9.0and22resolves to 22.23.4.Also: four of five workflows had no
cache: 'npm', the actions were three majors behind (checkoutandsetup-nodev4 -> v7,actions-gh-pagesv3.8.0 -> v4), and a comment indeploy.ymlstill described a Node 12 environment.Testing
full run on Node 22.23.4 at the tip of this stack
This covers the native type stripping #243 relies on, which needs Node 22.18 or newer.
Anything else
Stacked on
chore/node-testrather than cut from the default branch: #245 reformats four of these five files, so a parallel PR would conflict on every one.actions-gh-pages@v4is the one bump no run here exercises, sincedocs.ymlonly triggers on a release push.Left out on purpose:
deploy.ymlrunsnpm run buildbefore publishing and none of its output is packed, but the build doubles as a check that the docs still build before a release.