fix: run autoreview checks from repo root · openclaw/openclaw@f14a0ed
steipete
·
2026-05-18
·
via Recent Commits to openclaw:main
File tree
.agents/skills/autoreview/scripts
| Original file line number | Diff line number | Diff line change |
|---|
@@ -169,10 +169,12 @@ case "$fallback_reviewer" in
|
169 | 169 | esac |
170 | 170 | |
171 | 171 | repo_root=$(git rev-parse --show-toplevel) |
| 172 | +printf -v quoted_repo_root '%q' "$repo_root" |
172 | 173 | |
173 | 174 | has_package_check_script() { |
174 | 175 | command -v node >/dev/null 2>&1 || return 1 |
175 | | - node -e 'const p = require("./package.json"); process.exit(p.scripts?.check ? 0 : 1)' \ |
| 176 | + node -e 'const { readFileSync } = require("node:fs"); const p = JSON.parse(readFileSync(process.argv[1], "utf8")); process.exit(p.scripts?.check ? 0 : 1)' \ |
| 177 | +"$repo_root/package.json" \ |
176 | 178 | >/dev/null 2>&1 |
177 | 179 | } |
178 | 180 | |
@@ -231,10 +233,10 @@ case "$openclaw_maintainer_validation" in
|
231 | 233 | esac |
232 | 234 | if [[ -z "$parallel_tests" && "$openclaw_maintainer_validation" != 1 ]] && |
233 | 235 | ! auto_tests_disabled; then |
234 | | -if [[ -f package.json && -f pnpm-lock.yaml && -d node_modules ]] && |
| 236 | +if [[ -f "$repo_root/package.json" && -f "$repo_root/pnpm-lock.yaml" && -d "$repo_root/node_modules" ]] && |
235 | 237 | command -v pnpm >/dev/null 2>&1 && |
236 | 238 | has_package_check_script; then |
237 | | - parallel_tests="PNPM_CONFIG_OFFLINE=true pnpm run check" |
| 239 | + parallel_tests="cd $quoted_repo_root && PNPM_CONFIG_OFFLINE=true pnpm run check" |
238 | 240 | parallel_tests_auto=true |
239 | 241 | fi |
240 | 242 | fi |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。