Skip to content

Commit ea9cef8

Browse files
committed
ci: read the build Node version from .nvmrc
`node-version: 24` was repeated in thirteen setup-node steps across seven workflows with no single source. The number now lives in .nvmrc and every step that follows a checkout reads it with `node-version-file`. The one exception is the Vale publish job, which deliberately checks nothing out while it holds an OIDC identity, so there is no file for setup-node to read; it keeps a literal `node-version: 24` with a comment pointing at .nvmrc. 24 is the choice because it is the Active LTS line today (nodejs/Release schedule.json: LTS since 2025-10-28, maintenance from 2026-10-20). The Current line, 26, does not become LTS until 2026-10-28, seven weeks out, and the local toolchain runs 24.14.0. packages/cli's `engines.node` is a consumer-facing floor and is untouched.
1 parent f3432ed commit ea9cef8

8 files changed

Lines changed: 17 additions & 12 deletions

File tree

‎.github/workflows/demo-rule.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup Node
5858
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
5959
with:
60-
node-version: 24
60+
node-version-file: .nvmrc
6161

6262
- name: Install dependencies
6363
run: pnpm install --frozen-lockfile

‎.github/workflows/release-cli-changeset.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
5454
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
5555
with:
56-
node-version: 24
56+
node-version-file: .nvmrc
5757
cache: pnpm
5858
- run: pnpm install --frozen-lockfile --ignore-scripts
5959

‎.github/workflows/release-cli-nightly.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ jobs:
294294
echo "Building from ${actual}, which Validate passed on."
295295
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
296296
with:
297-
node-version: 24
297+
node-version-file: .nvmrc
298298

299299
# No dependency install in this job, by design — gate 1 is the reason the
300300
# workflow can decide before installing anything, and nightly-pack.cjs is
@@ -514,7 +514,7 @@ jobs:
514514
# NODE_AUTH_TOKEN in env until v7).
515515
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
516516
with:
517-
node-version: 24
517+
node-version-file: .nvmrc
518518
cache: pnpm
519519
registry-url: https://registry.npmjs.org
520520
# --ignore-scripts: no dependency lifecycle code runs while an OIDC
@@ -658,7 +658,7 @@ jobs:
658658
echo "Annotating from ${actual}, which Validate passed on."
659659
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
660660
with:
661-
node-version: 24
661+
node-version-file: .nvmrc
662662

663663
# A LOST UPDATE IS POSSIBLE HERE, AND IS ACCEPTED (Copilot review, #133).
664664
# A pull request body is replaced whole: GitHub offers no field-level

‎.github/workflows/release-cli.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
persist-credentials: false # no git writes here; don't leave the token in git config
7979
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
8080
with:
81-
node-version: 24
81+
node-version-file: .nvmrc
8282
- id: check
8383
run: |
8484
name=$(node -p "require('./packages/cli/package.json').name")
@@ -126,7 +126,7 @@ jobs:
126126
# so the OIDC exchange below is the only credential this job ever holds.
127127
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
128128
with:
129-
node-version: 24
129+
node-version-file: .nvmrc
130130
cache: pnpm
131131
registry-url: https://registry.npmjs.org
132132
- run: pnpm install --frozen-lockfile --ignore-scripts

‎.github/workflows/release-vale.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
151151
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
152152
with:
153-
node-version: 24
153+
node-version-file: .nvmrc
154154

155155
# No install step: the script is zero-dependency CommonJS. GITHUB_TOKEN is
156156
# passed only to raise the GitHub API rate limit; the endpoints are public.
@@ -238,7 +238,7 @@ jobs:
238238
persist-credentials: false
239239
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
240240
with:
241-
node-version: 24
241+
node-version-file: .nvmrc
242242
# --force on dispatch: an explicit human request publishes even when the
243243
# pinned version is already out. Only the automatic push path is gated.
244244
- id: gate
@@ -264,7 +264,7 @@ jobs:
264264
persist-credentials: false # nothing here writes to git
265265
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
266266
with:
267-
node-version: 24
267+
node-version-file: .nvmrc
268268

269269
# No dependency install at all: the script is zero-dependency CommonJS and
270270
# unpacks with `tar` and `unzip`, both present on ubuntu-latest. Nothing
@@ -335,6 +335,10 @@ jobs:
335335
# explains why (`always-auth` in .npmrc until v6.1, a dummy
336336
# NODE_AUTH_TOKEN in env until v7). The warning in issue #294 came from
337337
# this step's .npmrc under v4.4.0.
338+
#
339+
# A literal major rather than `node-version-file: .nvmrc`, because there
340+
# is no checkout here for the file to be read from. Keep it equal to
341+
# .nvmrc; this is the one place in the workflows the number is repeated.
338342
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
339343
with:
340344
node-version: 24

‎.github/workflows/update-badges.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090

9191
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
9292
with:
93-
node-version: 24
93+
node-version-file: .nvmrc
9494

9595
# No install step: the scripts are zero-dependency CommonJS. GITHUB_TOKEN
9696
# is passed only to raise the GitHub API rate limit on the Vale release

‎.github/workflows/validate.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Setup Node
5252
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
5353
with:
54-
node-version: 24
54+
node-version-file: .nvmrc
5555

5656
- name: Install dependencies
5757
run: pnpm install --frozen-lockfile

‎.nvmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

0 commit comments

Comments
 (0)