diff --git a/src/util/git.test.ts b/src/util/git.test.ts index 9f4a32b60..bf50c7ef3 100644 --- a/src/util/git.test.ts +++ b/src/util/git.test.ts @@ -43,7 +43,7 @@ describe("git utilities - GitHub Actions detection", () => { process.env.GITHUB_ACTIONS = "true"; process.env.GITHUB_REPOSITORY = "owner/repo"; - expect(getGitHubActionsRepoUrl()).toBe("https://github.com/owner/repo.git"); + expect(getGitHubActionsRepoUrl()).toBe("https://github.com/owner/repo"); }); it("should return GitHub URL with custom server", () => { @@ -51,7 +51,7 @@ describe("git utilities - GitHub Actions detection", () => { process.env.GITHUB_REPOSITORY = "owner/repo"; process.env.GITHUB_SERVER_URL = "https://github.enterprise.com"; - expect(getGitHubActionsRepoUrl()).toBe("https://github.enterprise.com/owner/repo.git"); + expect(getGitHubActionsRepoUrl()).toBe("https://github.enterprise.com/owner/repo"); }); }); @@ -63,7 +63,7 @@ describe("git utilities - GitHub Actions detection", () => { // Since we can't easily mock git commands, we'll rely on the fact that // GitHub Actions detection should take priority and return immediately const result = getGitHubActionsRepoUrl(); - expect(result).toBe("https://github.com/owner/repo.git"); + expect(result).toBe("https://github.com/owner/repo"); }); it("should work with GitHub Enterprise Server", () => { @@ -72,7 +72,7 @@ describe("git utilities - GitHub Actions detection", () => { process.env.GITHUB_SERVER_URL = "https://git.company.com"; const result = getGitHubActionsRepoUrl(); - expect(result).toBe("https://git.company.com/enterprise/repo.git"); + expect(result).toBe("https://git.company.com/enterprise/repo"); }); }); }); \ No newline at end of file diff --git a/src/util/git.ts b/src/util/git.ts index 659a6db0f..d82c2b212 100644 --- a/src/util/git.ts +++ b/src/util/git.ts @@ -58,7 +58,7 @@ export function getGitHubActionsRepoUrl(): string | null { // GITHUB_SERVER_URL defaults to https://github.com but can be different for GitHub Enterprise const serverUrl = process.env.GITHUB_SERVER_URL || "https://github.com"; - return `${serverUrl}/${githubRepository}.git`; + return `${serverUrl}/${githubRepository}`; } /**