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
Frostebite 2025-06-10 00:52:48 +01:00
parent 01bbef7a89
commit 36503e30c0
3 changed files with 13 additions and 13 deletions

12
dist/index.js generated vendored
View File

@ -4633,9 +4633,9 @@ class RemoteClient {
throw new Error('GIT_PRIVATE_TOKEN is not available');
}
// 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."ssh://git@github.com/".insteadOf`);
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."https://github.com/".insteadOf || true`);
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 || true`);
// 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 "ssh://git@github.com/"`);
@ -4654,9 +4654,9 @@ class RemoteClient {
throw new Error('GITHUB_TOKEN is not available as fallback');
}
// 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."ssh://git@github.com/".insteadOf`);
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."https://github.com/".insteadOf || true`);
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 || true`);
// 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 "ssh://git@github.com/"`);

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -232,9 +232,9 @@ export class RemoteClient {
}
// 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."ssh://git@github.com/".insteadOf`);
await CloudRunnerSystem.Run(`git config --global --unset-all url."git@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 || true`);
await CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf || true`);
// Set new URL configuration with token
await CloudRunnerSystem.Run(
@ -262,9 +262,9 @@ export class RemoteClient {
}
// 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."ssh://git@github.com/".insteadOf`);
await CloudRunnerSystem.Run(`git config --global --unset-all url."git@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 || true`);
await CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf || true`);
// Set new URL configuration with token
await CloudRunnerSystem.Run(