openclaw/scripts/watch-pr-ci.mjs
Peter Steinberger e67317ae3b
fix(tooling): let the CI watcher run from worktrees without node_modules (#158754)
* fix(tooling): resolve standalone CI watcher dependencies

Resolve missing bare imports from the scripts/pr tooling root in dependency-free worktrees. Keep local resolution first and scope the hook to the watcher child without creating a node_modules link or changing wrapper selection.

* fix(tooling): keep configured modules dirs on the watcher link path

* fix(tooling): validate CI watcher fallback dependencies

Validate explicitly selected tooling roots against repository identity and check fallback package versions against the caller manifest before loading code. Preserve canonical-default identity handling and successful local resolution.
2026-09-26 18:27:32 +00:00

20 lines
775 B
JavaScript

#!/usr/bin/env node
import { fileURLToPath } from "node:url";
import { runNodeCliShim } from "./lib/tsx-cli-shim.mjs";
import { watchPrCiDependencyOptions } from "./lib/watch-pr-ci-dependencies.mjs";
try {
await runNodeCliShim(import.meta.url, {
...watchPrCiDependencyOptions(fileURLToPath(new URL("..", import.meta.url))),
implementation: "./watch-pr-ci.mts",
// Native PR supervision owns this pipe; the metadata helper forwards it to gh.
// Inheriting only stdin/stdout/stderr would leave its environment flag dangling.
stdio:
process.env.OPENCLAW_PR_LOCK_NOTIFY_FD === "3"
? ["inherit", "inherit", "inherit", 3]
: "inherit",
});
} catch (error) {
console.error(`[watch-pr-ci] ${error.message}`);
process.exitCode = 1;
}