diff --git a/apps/web/src/actions/import.ts b/apps/web/src/actions/import.ts index 936d42d..6c7469f 100644 --- a/apps/web/src/actions/import.ts +++ b/apps/web/src/actions/import.ts @@ -14,6 +14,10 @@ export async function importRepository(prevState: any, formData: FormData) { return { error: "Repository name is required." }; } + if (repoName.length > 255) { + return { error: "Repository name must be 255 characters or less." }; + } + if (!repoName.includes("/") || repoName.split("/").length !== 2) { return { error: "Invalid format. Use owner/repo (e.g., facebook/react)." }; } diff --git a/apps/web/src/app/dashboard/import-form.tsx b/apps/web/src/app/dashboard/import-form.tsx index 6cdcd3e..434eb6e 100644 --- a/apps/web/src/app/dashboard/import-form.tsx +++ b/apps/web/src/app/dashboard/import-form.tsx @@ -20,6 +20,7 @@ export function ImportRepositoryForm() { name="repository" placeholder="owner/repo (e.g. facebook/react)" required + maxLength={255} className="flex-1 border border-gray-300 px-4 py-2 rounded-lg text-sm outline-none focus:border-black focus:ring-1 focus:ring-black transition-all" />