(branch: string)
| 201 | } |
| 202 | |
| 203 | export function validateRepositoryBranch(branch: string) { |
| 204 | if (!/^[A-Za-z0-9/_.-]+$/.test(branch) || branch.startsWith("-") || branch.includes("..")) { |
| 205 | throw new InvalidRepositoryBranchError({ |
| 206 | branch, |
| 207 | message: |
| 208 | "Branch must contain only alphanumeric characters, /, _, ., and -, and cannot start with - or contain ..", |
| 209 | }) |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | export function parseGitHubRemote(input: string) { |
| 214 | const cleaned = normalizeRepositoryInput(input) |