Allow reviewer runtime with remote origins
This commit is contained in:
@@ -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)'}`,
|
||||
|
||||
Reference in New Issue
Block a user