conclusion job: collect_usage_artifact_files.sh calls bare `node` (exit 127) on runners without node on PATH

已关闭 适合新手
#65,105 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
github-actions, node.js, shell
领域
ci-cd

调研方向

从 actions/setup/sh/collect_usage_artifact_files.sh 以及相关的 shell 测试(例如 check_mcp_servers_test.sh)开始。先使用不包含 node 的临时 PATH 运行脚本,然后使用 stub node 运行,并验证警告、退出状态、列表以及未改变的摘要行为;同时运行 pkg/workflow/evals_steps_test.go 中相关的检查。

由索引模型根据 Issue 内容生成。

描述

ai-inspected

Analysis

The conclusion job runs actions/setup/sh/collect_usage_artifact_files.sh (step built by buildUsageArtifactCollectionStep() in pkg/workflow/notify_comment.go). Its last real step is a bare node call (line 89 on main):

mkdir -p /tmp/gh-aw/usage/activity
node "${RUNNER_TEMP}/gh-aw/actions/generate_usage_activity_summary.cjs"
find /tmp/gh-aw/usage -type f -print | sort

Unlike the agent, detection and other jobs, the conclusion job gets no GenerateNodeJsSetupStep() (pkg/workflow/nodejs.go); its github-script steps use the runner's bundled node internally. On a self-hosted runner whose image has no node on PATH (the stock ghcr.io/actions/actions-runner image that ARC scale sets use ships node only under /home/runner/externals/node*), the call fails:

/home/runner/_work/_temp/gh-aw/actions/collect_usage_artifact_files.sh: line 73: node: command not found
##[error]Process completed with exit code 127.

The step is continue-on-error: true, so the job stays green, but every run carries an ##[error] annotation, usage/activity/summary.json is never produced, and the trailing find listing is skipped. The summary is best-effort by design (that is why the step is continue-on-error), so a missing node should degrade to a warning, not an error.

Reproduction

  1. Compile any workflow and run it on a self-hosted runner image where node is not on PATH (e.g. ghcr.io/actions/actions-runner as the ARC scale-set runner image).
  2. Open the conclusion job log: step "Collect usage artifact files" fails with exit code 127 as above.

Observed with gh-aw-actions/setup v0.90.0, engine: pi, runner.topology: arc-dind; the script on main still has the unguarded call.

Implementation Plan

Preferred: guard the call in the script (smallest change, works for every runner and topology, no extra setup step in every conclusion job).

  1. Guard the call (actions/setup/sh/collect_usage_artifact_files.sh, the node ...generate_usage_activity_summary.cjs line):
    if command -v node >/dev/null 2>&1; then
      node "${RUNNER_TEMP}/gh-aw/actions/generate_usage_activity_summary.cjs"
    else
      echo "::warning::node not found on PATH; skipping the usage activity summary"
    fi
    find /tmp/gh-aw/usage -type f -print | sort
    
    Keep the find listing running in both cases.
  2. Add a test actions/setup/sh/collect_usage_artifact_files_test.sh, in the style of the sibling *_test.sh scripts (e.g. check_mcp_servers_test.sh): run the script with a temporary PATH that contains the coreutils it needs but no node; assert exit code 0, the ::warning:: line is printed, and the find listing still appears. Add a second case with a stub node on PATH asserting it is invoked.
  3. Check pkg/workflow/evals_steps_test.go (it reads this script) still passes, and recompile the lock files that embed it.

Alternative (heavier, not preferred): prepend GenerateNodeJsSetupStep() to the conclusion job in notify_comment.go, which adds a setup step to every run just for a best-effort summary.

Acceptance Criteria

  • On a runner without node on PATH, "Collect usage artifact files" exits 0 and logs a ::warning::; no ##[error] annotation.
  • On a runner with node, behavior is unchanged and usage/activity/summary.json is generated.
  • The new shell test covers both cases.

Workaround on our side: a node symlink on PATH in the runner image.

主要语言
Go
星标
5.5k
派生
606
平均合并
4 小时 44 分钟
30 天内合并 PR
799

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/gh-aw 的其他 Issue

查看 github/gh-aw 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。