mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 10:30:37 +09:00
feat: support GitHub Enterprise URLs for skill and company imports
This commit is contained in:
parent
6c2c63e0f1
commit
9e1ee925cd
6 changed files with 116 additions and 54 deletions
|
|
@ -121,8 +121,7 @@ export function NewProjectDialog() {
|
|||
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 {
|
||||
|
|
@ -157,7 +156,7 @@ export function NewProjectDialog() {
|
|||
return;
|
||||
}
|
||||
if (repoUrl && !isGitHubRepoUrl(repoUrl)) {
|
||||
setWorkspaceError("Repo must use a valid GitHub repo URL.");
|
||||
setWorkspaceError("Repo must use a valid GitHub or GitHub Enterprise repo URL.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue