Allow reviewer runtime with remote origins

This commit is contained in:
Eyejoker
2026-04-05 05:30:26 +09:00
parent 10e7f2c563
commit da6e428650
4 changed files with 70 additions and 0 deletions

View File

@@ -203,6 +203,13 @@ function readGitOutput(
}).trim();
}
function isRemoteGitOrigin(originUrl: string): boolean {
return (
/^(?:https?|ssh|git):\/\//i.test(originUrl) ||
/^[^/\\]+@[^:]+:.+/.test(originUrl)
);
}
export function assertReadonlyWorkspaceRepoConnectivity(
baseEnv: NodeJS.ProcessEnv,
enabled: boolean,
@@ -227,6 +234,10 @@ export function assertReadonlyWorkspaceRepoConnectivity(
return;
}
if (isRemoteGitOrigin(originUrl)) {
return;
}
if (!path.isAbsolute(originUrl) || !fs.existsSync(originUrl)) {
throw new Error(
`EJClaw readonly runtime cannot access local git origin path: ${originUrl || '(missing)'}`,