feat: support GitHub Enterprise URLs for skill and company imports

This commit is contained in:
statxc 2026-04-01 20:42:48 +00:00
parent 6c2c63e0f1
commit 9e1ee925cd
6 changed files with 116 additions and 54 deletions

View file

@ -346,8 +346,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
const isGitHubRepoUrl = (value: string) => {
try {
const parsed = new URL(value);
const host = parsed.hostname.toLowerCase();
if (host !== "github.com" && host !== "www.github.com") return false;
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return false;
const segments = parsed.pathname.split("/").filter(Boolean);
return segments.length >= 2;
} catch {
@ -433,7 +432,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
return;
}
if (!isGitHubRepoUrl(repoUrl)) {
setWorkspaceError("Repo must use a valid GitHub repo URL.");
setWorkspaceError("Repo must use a valid GitHub or GitHub Enterprise repo URL.");
return;
}
setWorkspaceError(null);