Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/typescript/src/bulk-scan-discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
16 changes: 16 additions & 0 deletions sdk/typescript/tests-ts/bulk-scan-discovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down