Agent-job engine-install "Setup Node.js" step ignores `runtimes.node.version`

Đang mở Phù hợp với người mới
#76,559 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, go
Lĩnh vực
ci-cd, devtools

Hướng nghiên cứu

Đọc pkg/workflow/nodejs.go và lần theo generateNodeJsSetupStep(data) cùng với resolveNodeSetupActionOverride(data) để xem các thiết lập runtime được truyền đến bước thiết lập được tạo ra như thế nào. Kiểm tra cách biểu diễn các giá trị runtimes.node.version được nhập, sau đó chạy các bài kiểm thử workflow liên quan hoặc thêm một trường hợp tập trung. Hoàn tất khi bước thiết lập cài đặt engine của agent job sử dụng phiên bản đã ghim, kể cả khi phiên bản đó được nhập, thay vì phiên bản mặc định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

ai-inspected

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.

Ngôn ngữ chính
Go
Star
5.6k
Fork
615
Merge trung bình
5 giờ 21 phút
Pull request đã merge (30 ngày)
792

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/gh-aw

Tất cả issue của github/gh-aw

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.