From 10ee1a75f67f6e422e4b9d91f0d9cce3ecacf341 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Feb 2026 20:06:19 +0000 Subject: [PATCH 1/2] Initial plan From 7139ea989fe062518a9bea6d1e60c781ca61cc98 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Feb 2026 20:12:45 +0000 Subject: [PATCH 2/2] Fix git_helpers test timeout by avoiding network operations The test was timing out because it attempted to execute `git fetch` with a URL containing credentials, which tried to make a real network connection to GitHub. Changed the test to use `git config --get` with a URL containing credentials instead. This command fails immediately without attempting network access, while still validating that credentials in URLs are properly redacted in the logs. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/git_helpers.test.cjs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/actions/setup/js/git_helpers.test.cjs b/actions/setup/js/git_helpers.test.cjs index e5d2bd3d1ae..07f47777c4e 100644 --- a/actions/setup/js/git_helpers.test.cjs +++ b/actions/setup/js/git_helpers.test.cjs @@ -80,18 +80,20 @@ describe("git_helpers.cjs", () => { }; try { - // Try a git command with a URL containing credentials (will fail but that's ok) + // Use a git command that doesn't require network access + // We'll use 'ls-remote' with --exit-code and a URL with credentials + // This will fail quickly without attempting network access try { - execGitSync(["fetch", "https://user:token@github.com/repo.git", "main"]); + execGitSync(["config", "--get", "remote.https://user:token@github.com/repo.git.url"]); } catch (e) { // Expected to fail, we're just checking the logging } // Check that credentials were redacted in the log - const fetchLog = debugLogs.find(log => log.includes("git fetch")); - expect(fetchLog).toBeDefined(); - expect(fetchLog).toContain("https://***@github.com/repo.git"); - expect(fetchLog).not.toContain("user:token"); + const configLog = debugLogs.find(log => log.includes("git config")); + expect(configLog).toBeDefined(); + expect(configLog).toContain("https://***@github.com/repo.git"); + expect(configLog).not.toContain("user:token"); } finally { global.core = originalCore; }