fix: Artificer GitHub SSH absolute-path git fetch
This commit is contained in:
+22
-2
@@ -262,7 +262,8 @@ function codexShellSandbox(policy: ExecutionPolicy): string {
|
||||
}
|
||||
|
||||
function toolCredentialEnvVars(items: ToolCredentialProjection[]): JsonRecord[] {
|
||||
return items.filter((item): item is ToolCredentialEnvProjection => item.kind === "env").map((item) => ({
|
||||
return [
|
||||
...items.filter((item): item is ToolCredentialEnvProjection => item.kind === "env").map((item) => ({
|
||||
name: item.envName,
|
||||
valueFrom: {
|
||||
secretKeyRef: {
|
||||
@@ -270,7 +271,26 @@ function toolCredentialEnvVars(items: ToolCredentialProjection[]): JsonRecord[]
|
||||
key: item.secretKey,
|
||||
},
|
||||
},
|
||||
}));
|
||||
})),
|
||||
...githubSshCommandEnvVars(items),
|
||||
];
|
||||
}
|
||||
|
||||
function githubSshCommandEnvVars(items: ToolCredentialProjection[]): JsonRecord[] {
|
||||
const credential = items.find((item): item is ToolCredentialVolumeProjection => item.kind === "volume" && item.tool === "github" && item.purpose === "github-ssh");
|
||||
if (!credential) return [];
|
||||
const mountPath = credential.mountPath.replace(/\/+$/u, "");
|
||||
return [{
|
||||
name: "GIT_SSH_COMMAND",
|
||||
value: [
|
||||
"ssh",
|
||||
"-F", `${mountPath}/config`,
|
||||
"-i", `${mountPath}/id_ed25519`,
|
||||
"-o", "IdentitiesOnly=yes",
|
||||
"-o", "StrictHostKeyChecking=yes",
|
||||
"-o", `UserKnownHostsFile=${mountPath}/known_hosts`,
|
||||
].join(" "),
|
||||
}];
|
||||
}
|
||||
|
||||
function toolCredentialVolumeMounts(items: ToolCredentialProjection[]): JsonRecord[] {
|
||||
|
||||
Reference in New Issue
Block a user