Update git configuration commands in RemoteClient to ensure robust URL unsetting
- Modified the git configuration commands to append '|| true' to prevent errors if the specified URLs do not exist. - This change enhances the reliability of the URL clearing process in the RemoteClient class, ensuring smoother execution during token-based authentication setups.pull/729/head
parent
01bbef7a89
commit
36503e30c0
|
@ -4633,9 +4633,9 @@ class RemoteClient {
|
||||||
throw new Error('GIT_PRIVATE_TOKEN is not available');
|
throw new Error('GIT_PRIVATE_TOKEN is not available');
|
||||||
}
|
}
|
||||||
// Clear any existing URL configurations
|
// Clear any existing URL configurations
|
||||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."https://github.com/".insteadOf`);
|
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."https://github.com/".insteadOf || true`);
|
||||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."ssh://git@github.com/".insteadOf`);
|
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."ssh://git@github.com/".insteadOf || true`);
|
||||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf`);
|
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf || true`);
|
||||||
// Set new URL configuration with token
|
// Set new URL configuration with token
|
||||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global url."https://${gitPrivateToken}@github.com/".insteadOf "https://github.com/"`);
|
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global url."https://${gitPrivateToken}@github.com/".insteadOf "https://github.com/"`);
|
||||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global url."https://${gitPrivateToken}@github.com/".insteadOf "ssh://git@github.com/"`);
|
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global url."https://${gitPrivateToken}@github.com/".insteadOf "ssh://git@github.com/"`);
|
||||||
|
@ -4654,9 +4654,9 @@ class RemoteClient {
|
||||||
throw new Error('GITHUB_TOKEN is not available as fallback');
|
throw new Error('GITHUB_TOKEN is not available as fallback');
|
||||||
}
|
}
|
||||||
// Clear any existing URL configurations
|
// Clear any existing URL configurations
|
||||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."https://github.com/".insteadOf`);
|
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."https://github.com/".insteadOf || true`);
|
||||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."ssh://git@github.com/".insteadOf`);
|
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."ssh://git@github.com/".insteadOf || true`);
|
||||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf`);
|
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf || true`);
|
||||||
// Set new URL configuration with token
|
// Set new URL configuration with token
|
||||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global url."https://${githubToken}@github.com/".insteadOf "https://github.com/"`);
|
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global url."https://${githubToken}@github.com/".insteadOf "https://github.com/"`);
|
||||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global url."https://${githubToken}@github.com/".insteadOf "ssh://git@github.com/"`);
|
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global url."https://${githubToken}@github.com/".insteadOf "ssh://git@github.com/"`);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -232,9 +232,9 @@ export class RemoteClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear any existing URL configurations
|
// Clear any existing URL configurations
|
||||||
await CloudRunnerSystem.Run(`git config --global --unset-all url."https://github.com/".insteadOf`);
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."https://github.com/".insteadOf || true`);
|
||||||
await CloudRunnerSystem.Run(`git config --global --unset-all url."ssh://git@github.com/".insteadOf`);
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."ssh://git@github.com/".insteadOf || true`);
|
||||||
await CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf`);
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf || true`);
|
||||||
|
|
||||||
// Set new URL configuration with token
|
// Set new URL configuration with token
|
||||||
await CloudRunnerSystem.Run(
|
await CloudRunnerSystem.Run(
|
||||||
|
@ -262,9 +262,9 @@ export class RemoteClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear any existing URL configurations
|
// Clear any existing URL configurations
|
||||||
await CloudRunnerSystem.Run(`git config --global --unset-all url."https://github.com/".insteadOf`);
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."https://github.com/".insteadOf || true`);
|
||||||
await CloudRunnerSystem.Run(`git config --global --unset-all url."ssh://git@github.com/".insteadOf`);
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."ssh://git@github.com/".insteadOf || true`);
|
||||||
await CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf`);
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf || true`);
|
||||||
|
|
||||||
// Set new URL configuration with token
|
// Set new URL configuration with token
|
||||||
await CloudRunnerSystem.Run(
|
await CloudRunnerSystem.Run(
|
||||||
|
|
Loading…
Reference in New Issue