( provider: Provider, repositoryName: string, host?: string | null, )
| 253 | * constructRepositoryUrl("bitbucket", "owner/repo") // "https://bitbucket.org/owner/repo" |
| 254 | */ |
| 255 | export const constructRepositoryUrl = ( |
| 256 | provider: Provider, |
| 257 | repositoryName: string, |
| 258 | host?: string | null, |
| 259 | ): string => { |
| 260 | const baseUrl = ensureHttpsPrefix(host); |
| 261 | if (provider === "bitbucket_data_center") { |
| 262 | const [project, repo] = repositoryName.split("/"); |
| 263 | return `${baseUrl}/projects/${project}/repos/${repo}`; |
| 264 | } |
| 265 | return `${baseUrl}/${repositoryName}`; |
| 266 | }; |
| 267 | |
| 268 | /** |
| 269 | * Construct the branch URL for different providers |
no test coverage detected