Skip to content

fix(ci): pin pnpm to 11.12.0 to avoid 11.13.0 install regression#2876

Open
lzxue wants to merge 1 commit into
masterfrom
fix/ci-pnpm-version
Open

fix(ci): pin pnpm to 11.12.0 to avoid 11.13.0 install regression#2876
lzxue wants to merge 1 commit into
masterfrom
fix/ci-pnpm-version

Conversation

@lzxue

@lzxue lzxue commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

问题

最近所有基于 master 的新 PR,CI 的 lint / unit-test / size-test 三个 job 都在 install 阶段 ~10s 内失败

[ERROR] Cannot use 'in' operator to search for 'integrity' in undefined
For help, run: pnpm help install
##[error]Process completed with exit code 1.

复现 PR(与各自代码改动无关,均在 install 阶段崩):

根因

.github/actions/prepare-install/action.yml 用浮动版本:

- uses: pnpm/action-setup@v3
  with:
    version: 11      # 解析到最新 11.x = 11.13.0

version: 11 近期解析到新发布的 pnpm 11.13.0,它与当前 lockfile(由 pnpm@11.12.0 生成)不兼容,在 pnpm install 解析 lockfile 时崩溃。

对照证据:更早的 PR(#2863 / #2856 / #2853 等)跑 lint (20.x) 全 pass、耗时 2 分钟+(真正跑了测试)——彼时 11.x 还解析到 11.12.0/更早版本;近期 11.13.0 发布后才 regression。

修复

固定为 11.12.0,与 package.jsonpackageManager: "pnpm@11.12.0" 一致:

-        version: 11
+        version: 11.12.0

验证

本 PR 的 CI 会用固定后的 11.12.0 运行 —— 若 install 通过、lint/unit/size 正常跑起来,即验证修复。

说明

prepare-install 复合 action 原用浮动 version: 11,最近解析到新发布的
pnpm 11.13.0,导致 pnpm install 在解析 lockfile 时崩溃:

  [ERROR] Cannot use 'in' operator to search for 'integrity' in undefined

影响所有基于当前 master 的新 PR(lint/unit-test/size-test 在 install
阶段即失败,~10s),与各 PR 的代码改动无关。

固定为 11.12.0(与 package.json 的 packageManager 字段一致)。
action-setup@v3 本身可读 packageManager,但显式 pin 更稳妥。
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 646b0d3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the pnpm version to 11.12.0 in the prepare-install GitHub action. The reviewer suggested removing the explicit version parameter entirely to leverage pnpm/action-setup's ability to automatically read the version from package.json, thereby avoiding duplicate maintenance of the version number.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 12 to +14
- uses: pnpm/action-setup@v3
with:
version: 11
version: 11.12.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

由于 package.json 中已经声明了 "packageManager": "pnpm@11.12.0",且 pnpm/action-setup 在未显式指定 version 时会自动读取并使用 package.json 中的 packageManager 字段。为了避免在多个地方重复维护 pnpm 的版本号(遵循单一数据源原则),建议直接移除 version 参数和 with 块。这样后续升级 pnpm 时,只需在 package.json 中进行修改即可。

    - uses: pnpm/action-setup@v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant