| 1 | import { parseChangeRequestUrl } from "@t3tools/shared/changeRequestUrl"; |
| 2 | |
| 3 | export function nativePullRequestDestination( |
| 4 | url: string, |
| 5 | context: { environmentId: string; projectId: string } | null, |
| 6 | ) { |
| 7 | const parsed = parseChangeRequestUrl(url); |
| 8 | if (!parsed || !context) return null; |
| 9 | return { |
| 10 | ...context, |
| 11 | repository: parsed.repository, |
| 12 | number: parsed.number, |
| 13 | host: parsed.authority ?? parsed.host, |
| 14 | }; |
| 15 | } |