chore: ci update#18573
Conversation
概览跨多个 GitHub Actions 工作流文件更新依赖项版本,包括 actions/checkout 从 v4 升级到 v5、actions/setup-node 从 v4 升级到 v6、actions/download-artifact 从 v4 升级到 v6,并修复 YAML 格式问题。nodejs.yml 重新引入了显式的目标映射配置。 变更
估计代码审查工作量🎯 2 (简单) | ⏱️ ~12 分钟
可能相关的 PR
建议的审查者
诗歌
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
.github/workflows/auto-review.yml(1 hunks).github/workflows/build-rust-binding.yml(1 hunks).github/workflows/build-rust-wasm.yml(1 hunks).github/workflows/dependabot-update-lockfile.yml(2 hunks).github/workflows/issue-labeler.yml(3 hunks).github/workflows/nodejs.yml(3 hunks).github/workflows/publish.yml(7 hunks).github/workflows/sync-components-types.yml(3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-07-01T15:46:08.457Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17937
File: .github/workflows/issue-labeler.yml:31-31
Timestamp: 2025-07-01T15:46:08.457Z
Learning: stefanbuck/github-issue-parserv3 GitHub Action 的输出字段名称是 `jsonString`,不是 `json`。在工作流中应该使用 `${{ steps.issue-parser.outputs.jsonString }}` 来引用解析后的 JSON 数据。
Applied to files:
.github/workflows/issue-labeler.yml
📚 Learning: 2025-08-09T21:41:18.741Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17842
File: .github/workflows/merged.yml:34-41
Timestamp: 2025-08-09T21:41:18.741Z
Learning: 在 NervJS/taro 项目中,merged.yml workflow 故意使用 actions/upload-artifact 而非 actions/cache/save 来保存公共 NX 缓存,因为 Artifact 具有更长的保留时间(最多 90 天),而 Actions Cache 仅保留 7 天。缓存键采用精确匹配策略,不使用 restore-keys 前缀匹配。
Applied to files:
.github/workflows/nodejs.yml
📚 Learning: 2025-08-08T02:32:58.265Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18146
File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14
Timestamp: 2025-08-08T02:32:58.265Z
Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。
Applied to files:
.github/workflows/nodejs.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
- GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
- GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
- GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
- GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (16)
.github/workflows/issue-labeler.yml (2)
20-20: 新增 checkout action。新增 checkout@v5 符合系统性工作流升级的需求。此前工作流似乎缺少显式的checkout步骤,现在添加可确保最新的issue template文件被正确解析。
4-4: 验证 actions/checkout@v5 运行时要求,确保 Actions Runner 满足最低版本条件。YAML 数组格式化改进(
[ opened ]→[opened])符合 YAML 最佳实践。checkout@v5 升级至 Node 24 运行时,需要 Actions Runner 最低版本 v2.327.1。请确认工作流所在的环境满足此要求。若环境已使用现代版本的 GitHub Actions Runner,则此变更可安全应用。.github/workflows/dependabot-update-lockfile.yml (2)
31-31: 字符串引号风格统一。
filePath从双引号改为单引号是YAML风格的一致性调整。功能无变化。
15-17: checkout@v5 升级与 dependabot PR 工作流兼容。验证结果确认,actions/checkout@v5 不存在与 pull_request_target 事件相关的破坏性变更。v5 升级主要是运行时环境升级(Node 24、最低运行程序版本),现有的 pull_request/pull_request_target 使用模式仍然完全支持。代码中使用
github.head_ref的方式在 v5 中继续有效。.github/workflows/publish.yml (3)
366-366: 字符串引号风格统一。
git_tag_prefix: 'v'使用单引号是YAML风格调整。功能无变化。
173-173: 验证 download-artifact@v6 与上传的制品兼容性。下载由 action/upload-artifact@v3 及更早版本创建的制品不受支持。 Artifacts v4 与之前的版本不兼容——例如,使用 v3 上传的制品无法与 actions/download-artifact@v4 一起使用。
v6 更新至支持 Node v24.x,并将 @actions/artifact 升级至 v4.0.0。 由于 v6 与 v4/v5 使用相同的 @actions/artifact 后端,理论上应兼容 v4 上传的制品。
需手动确认以下内容:
- .github/workflows/publish.yml 中 upload-artifact 使用的版本
- 确保 upload-artifact 和 download-artifact 使用匹配的主版本(都是 v4+ 或都是 v3 及以下)
- 验证制品命名约定 (bindings-${{ matrix.target }}) 在上传和下载步骤中保持一致
102-102: setup-node@v6 升级与 npm 认证兼容,无需修改。代码实际配置已验证:工作流在第 102 行使用
setup-node@v6,并正确指定了registry-url: 'https://registry.npmjs.org';第 396 行通过NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}设置认证。根据 setup-node v6 文档,该版本继续通过 env 中的 NODE_AUTH_TOKEN 配置 .npmrc,与此配置完全兼容,不存在破坏性改变。.github/workflows/sync-components-types.yml (4)
22-22: YAML 语法规范化。
run: |格式调整是YAML规范化。功能无变化。
64-68: PR 创建字符串使用单引号。PR 的 body、branch、commit-message、title 都改为单引号字符串。这是YAML风格统一,功能无变化。
14-14: actions/checkout@v5 支持多仓库检出,无需修改。actions/checkout@v5 的 README 文档仍然支持相同的多仓库场景(并排、嵌套、私有),不存在影响多仓库检出的特殊 breaking changes。工作流中的双重 checkout@v5(第 14 行和第 17 行)可以正常同步这两个仓库的类型定义。v5 的主要变化是运行时版本提升至 node24,需要确保 runner 版本不低于 v2.327.1。
46-46: setup-node@v6 完全兼容当前配置,无需修改工作流中已显式指定
node-version: 18和cache: 'pnpm'。v6 的破坏性变化(自动缓存限制为 npm)仅影响未显式设置缓存的情况;当前工作流显式配置了缓存,因此不受影响。Node 版本选择机制在 v6 中保持不变,node18 锁定将继续有效,ts-node 与 node20 的兼容性问题不会出现。.github/workflows/build-rust-wasm.yml (1)
12-12: actions/checkout@v5 兼容性已验证。v5 相比 v4 没有特性级别的破坏性变化,主要要求是运行时兼容性:Node 24 支持和 GitHub Actions Runner >= v2.327.1。对于标准的 GitHub 托管 Runner,这些要求已满足。升级安全,无需进一步操作。
.github/workflows/auto-review.yml (1)
14-14: actions/checkout@v5 升级安全可靠。auto-review.yml 使用
runs-on: ubuntu-latest(GitHub 托管 runner),GitHub 自动维护该环境以支持最新的 actions,无需担心 v5 所需的 Node 24 runtime 或 Actions Runner 版本兼容性问题。YAML 格式化修正(移除name :中的多余空格)符合最佳实践。所有变更均正确无误。.github/workflows/build-rust-binding.yml (1)
48-48: 工作流配置已正确处理 setup-node@v6 与 pnpm v10 的兼容性,无需修改。验证结果确认配置完全符合 actions/setup-node@v6 的要求:pnpm/action-setup@v4 在 setup-node@v6 之前安装了 pnpm v10,且 setup-node 已显式配置
cache: 'pnpm'。这正是 v6 所要求的显式缓存启用模式(v6 不再自动为 pnpm 启用缓存)。多平台构建(macOS、Windows、Linux)配置正确,Docker 环境通过条件判断独立处理,无兼容性风险。.github/workflows/nodejs.yml (2)
81-81: 验证完成:download-artifact@v6 与当前工作流配置兼容,无需修改。已确认:
- build-rust-binding.yml 使用 upload-artifact@v4 上传
bindings-${{ matrix.settings.target }}- nodejs.yml 使用 download-artifact@v6 下载相同工件,版本对齐且兼容(两者均基于 @actions/artifact v4)
- Line 81 的
bindings-${{ matrix.target }}命名模式与 v6 兼容- Line 94 的通用路径下载操作在 v6 中正常工作
v6 的主要变更(Node 24 运行时、@actions/artifact v4 依赖)已妥善处理,工作流配置无需调整。
66-66: setup-node@v6 的跨平台缓存配置已正确实现,无需修改。根据web查询和工作流检查,您的担忧是有效的:setup-node@v6 在缓存行为上有重大变更,npm自动缓存,但yarn/pnpm需显式配置。
验证结果表明:工作流已正确处理此问题。在第72行,setup-node@v6已明确设置
cache: 'pnpm',而非依赖自动检测。配合pnpm/action-setup@v4的设置,该配置在所有三个平台(macos-13、windows-latest、ubuntu-latest)上保证一致的缓存和Node版本处理行为。
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18573 +/- ##
=======================================
Coverage 55.97% 55.97%
=======================================
Files 416 416
Lines 21563 21563
Branches 5282 5285 +3
=======================================
Hits 12070 12070
- Misses 7915 8010 +95
+ Partials 1578 1483 -95
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
这个 PR 做了什么? (简要描述所做更改)
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台: