From ef14219a2135de9f22eb957098c72ce18bd70f3f Mon Sep 17 00:00:00 2001 From: Phantom Date: Thu, 26 Feb 2026 23:49:58 +0800 Subject: [PATCH] chore: use node-version-file for CI workflows (#13076) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What this PR does Before this PR: - CI workflows hardcoded `node-version: 22` - `.node-version` and `.nvmrc` files were at version 22 After this PR: - All CI workflows read Node version from `.node-version` file using `node-version-file: '.node-version'` - `.node-version` and `.nvmrc` updated to `24.11.1` to match Electron runtime version Fixes # ### Why we need it and why it was done in this way The project recently updated Node.js requirement to 24.11.1 in package.json, but the CI workflows were still hardcoded to use Node 22, causing warning. This change makes the CI workflows automatically use the Node version defined in `.node-version` file, ensuring consistency between local development and CI environments. The following tradeoffs were made: - Using `.node-version` instead of reading from `package.json` directly - simpler and more compatible with GitHub Actions The following alternatives were considered: Links to places where the discussion took place: ### Breaking changes If this PR introduces breaking changes, please describe the changes and the impact on users. ### Special notes for your reviewer ### Checklist This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR. Approvers are expected to review this list. - [x] PR: The PR description is expressive enough and will help future contributors - [x] Code: [Write code that humans can understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans) and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle) - [x] Refactor: You have [left the code cleaner than you found it (Boy Scout Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html) - [x] Upgrade: Impact of this change on upgrade flows was considered and addressed if required - [x] Documentation: A [user-guide update](https://docs.cherry-ai.com) was considered and is present (link) or not required. Check this only when the PR introduces or changes a user-facing feature or behavior. - [x] Self-review: I have reviewed my own code (e.g., via [`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`, or GitHub UI) before requesting review from others ### Release note ```release-note NONE ``` Co-authored-by: Claude Opus 4.6 --- .github/workflows/auto-i18n.yml | 2 +- .github/workflows/ci.yml | 10 +++++----- .github/workflows/github-issue-tracker.yml | 4 ++-- .github/workflows/nightly-build.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/sync-to-gitcode.yml | 2 +- .github/workflows/update-app-upgrade-config.yml | 2 +- .node-version | 2 +- .nvmrc | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/auto-i18n.yml b/.github/workflows/auto-i18n.yml index 106cef17c1..745c49a1b4 100644 --- a/.github/workflows/auto-i18n.yml +++ b/.github/workflows/auto-i18n.yml @@ -30,7 +30,7 @@ jobs: - name: 📦 Setting Node.js uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: 📦 Install pnpm uses: pnpm/action-setup@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5f9e6aae4..d629efa163 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: Install pnpm uses: pnpm/action-setup@v4 @@ -119,7 +119,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: Install pnpm uses: pnpm/action-setup@v4 @@ -170,7 +170,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: Install pnpm uses: pnpm/action-setup@v4 @@ -206,7 +206,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: Install pnpm uses: pnpm/action-setup@v4 @@ -241,7 +241,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: Install pnpm uses: pnpm/action-setup@v4 diff --git a/.github/workflows/github-issue-tracker.yml b/.github/workflows/github-issue-tracker.yml index 36f6872fda..1f379c286e 100644 --- a/.github/workflows/github-issue-tracker.yml +++ b/.github/workflows/github-issue-tracker.yml @@ -56,7 +56,7 @@ jobs: if: steps.check_time.outputs.should_delay == 'false' uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: Install pnpm uses: pnpm/action-setup@v4 @@ -148,7 +148,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: Install pnpm uses: pnpm/action-setup@v4 diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 146d9e4f6f..bc227a45e0 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -58,7 +58,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: macos-latest dependencies fix if: matrix.os == 'macos-latest' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5dc6421a8..fe4a8da2b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: macos-latest dependencies fix if: matrix.os == 'macos-latest' diff --git a/.github/workflows/sync-to-gitcode.yml b/.github/workflows/sync-to-gitcode.yml index bfc544d405..5d533681eb 100644 --- a/.github/workflows/sync-to-gitcode.yml +++ b/.github/workflows/sync-to-gitcode.yml @@ -46,7 +46,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6 with: - node-version: 22 + node-version-file: '.node-version' - name: Install pnpm uses: pnpm/action-setup@v4 diff --git a/.github/workflows/update-app-upgrade-config.yml b/.github/workflows/update-app-upgrade-config.yml index 49f3e64bb4..14d41c13c0 100644 --- a/.github/workflows/update-app-upgrade-config.yml +++ b/.github/workflows/update-app-upgrade-config.yml @@ -152,7 +152,7 @@ jobs: if: steps.check.outputs.should_run == 'true' uses: actions/setup-node@v4 with: - node-version: 22 + node-version-file: '.node-version' - name: Enable corepack if: steps.check.outputs.should_run == 'true' diff --git a/.node-version b/.node-version index 2bd5a0a98a..9e2934aa34 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -22 +24.11.1 diff --git a/.nvmrc b/.nvmrc index 2bd5a0a98a..9e2934aa34 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -22 +24.11.1