diff --git a/sdk/typescript/src/bulk-scan-discovery.ts b/sdk/typescript/src/bulk-scan-discovery.ts index cfad210..62c42e6 100644 --- a/sdk/typescript/src/bulk-scan-discovery.ts +++ b/sdk/typescript/src/bulk-scan-discovery.ts @@ -139,7 +139,7 @@ export async function runBulkScanWizard( } signal?.throwIfAborted(); - const githubHost = dependencies.githubHost ?? "github.com"; + const githubHost = (dependencies.githubHost ?? "github.com").toLowerCase(); const github = await dependencies.createGitHub(githubHost, signal); const owner = await selectGitHubOwner(github, prompt, signal); prompt.write("\nFinding active repositories...\n"); diff --git a/sdk/typescript/tests-ts/bulk-scan-discovery.test.ts b/sdk/typescript/tests-ts/bulk-scan-discovery.test.ts index a833764..f03bcf2 100644 --- a/sdk/typescript/tests-ts/bulk-scan-discovery.test.ts +++ b/sdk/typescript/tests-ts/bulk-scan-discovery.test.ts @@ -321,6 +321,22 @@ describe("bulk scan repository discovery", () => { ); }); + test("normalizes configured GitHub host names", async () => { + const root = await temporaryDirectory(); + const { dependencies, prompt, hosts } = discoveryDependencies(root, { + host: "GitHub.COM", + }); + prompt.confirms = [true]; + + const result = await runBulkScanWizard(dependencies); + + expect(result?.githubHost).toBe("github.com"); + expect(hosts).toEqual(["github.com"]); + expect(await readFile(result!.inputPath, "utf8")).toContain( + "https://github.com/acme/payments-api.git", + ); + }); + test("requires an existing GitHub sign-in", async () => { const root = await temporaryDirectory(); const { dependencies, requests } = discoveryDependencies(root, {