【调整】打包配置调整

This commit is contained in:
chenzhihua
2025-07-17 14:02:54 +08:00
parent 260601055f
commit 074f2c5903
78 changed files with 1358 additions and 825 deletions

View File

@@ -53,7 +53,20 @@ const AutoCommitConfigSchema = z
// Git项目配置模式
const GitProjectConfigSchema = z.object({
repo: z.string().url({ message: "Invalid Git repository URL" }),
repo: z.string().refine(
(value) => {
// 支持HTTPS格式: https://github.com/user/repo.git
const httpsPattern = /^https:\/\/[^\s\/$.?#].[^\s]*\.git$/;
// 支持SSH格式: git@github.com:user/repo.git 或 ssh://git@host:port/path/repo.git
const sshPattern = /^(git@[^\s:]+:[^\s]+\.git|ssh:\/\/[^\s]+\.git)$/;
return httpsPattern.test(value) || sshPattern.test(value);
},
{
message:
"Invalid Git repository URL. Supported formats: https://github.com/user/repo.git or git@github.com:user/repo.git",
},
),
branch: z.string().min(1, { message: "Git branch cannot be empty" }),
targetDir: z.string().min(1, { message: "Git targetDir cannot be empty" }),
projectName: z.string().optional(),