Agent-job engine-install "Setup Node.js" step ignores `runtimes.node.version`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
调研方向
阅读 pkg/workflow/nodejs.go,并追踪 generateNodeJsSetupStep(data) 和 resolveNodeSetupActionOverride(data),了解运行时设置如何传递到生成的设置步骤。检查导入的 runtimes.node.version 值如何表示,然后运行相关的 workflow 测试或添加一个有针对性的用例。完成标准是:agent job 的引擎安装设置使用固定版本,包括导入的固定版本,而不是默认版本。
由索引模型根据 Issue 内容生成。
描述
Summary
When a workflow pins runtimes.node.version, the agent job still gets a second Setup Node.js step that uses the compiler default node-version: '24'. That step comes right before Install AWF binary / the engine CLI install, so it runs after the pinned runtime setup step and overrides it on PATH. The agent and the engine CLI therefore run on whatever 24.x the runner resolves, not on the pinned version.
This is the same class of bug as #65939 (threat-detection job), which ADR 66040 fixed only for the detection / evals jobs.
Repro
Frontmatter:
engine:
id: claude
runtimes:
node:
version: "24.22.1"
Compiled with gh-aw v0.93.2, the agent job contains:
- name: Setup Node.js # runtime setup step, honors the pin
uses: actions/setup-node@... # v7.1.0
with:
node-version: '24.22.1'
...
- name: Setup Node.js # engine install step, ignores the pin
uses: actions/setup-node@... # v7.1.0
with:
node-version: '24'
package-manager-cache: false
- name: Install AWF binary
- name: Install Claude Code CLI
The detection job correctly emits '24.22.1'.
Cause
pkg/workflow/nodejs.go, generateNodeJsSetupStep hardcodes constants.DefaultNodeVersion:
fmt.Sprintf(" node-version: '%s'", constants.DefaultNodeVersion),
It already honors runtimes.node.action-repo / action-version through resolveNodeSetupActionOverride(data), but not version. This is still the case on main as of 2026-11-10 (also present in v1.2.2).
Expected
When runtimes.node.version is set (including through imports), generateNodeJsSetupStep(data) should emit that version. Alternatively, it should skip the redundant setup-node step when the runtime setup step has already installed Node in the same job.
Impact
Anyone who pins Node for a security fix ends up with the engine and agent running on an unpinned Node. The only workaround is to hand-patch the .lock.yml after every gh aw compile.
- 主要语言
- Go
- 星标
- 5.6k
- 派生
- 615
- 平均合并
- 5 小时 21 分钟
- 30 天内合并 PR
- 792
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/gh-aw 的其他 Issue
-
automation documentation
难度 1/5 1 小时以内 新手友好度 78/100
维护者通常 1 天内回复
-
agent-research cookie
难度 2/5 1-3 小时 新手友好度 69/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
awf community
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
automation cli-tools testing
难度 1/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
GitHub webhook is not subscribed to release events, so `event: release` never triggers可能已有人在做 @qsun 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
woodpecker-ci/woodpecker#7542 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
zilliztech/milvus-backup#1386 ·
维护者通常 1 天内回复
-
Pipelined flush no longer observes kill signals after #2042: flush backoffer is built with nil vars未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复