( config: Pick<GithubConfig, 'name' | 'owner' | 'useSsh'>, githubToken?: string, )
| 27 | |
| 28 | /** Gets the repository Git URL for the given github config. */ |
| 29 | export function getRepositoryGitUrl( |
| 30 | config: Pick<GithubConfig, 'name' | 'owner' | 'useSsh'>, |
| 31 | githubToken?: string, |
| 32 | ): string { |
| 33 | if (config.useSsh) { |
| 34 | return `git@github.com:${config.owner}/${config.name}.git`; |
| 35 | } |
| 36 | const baseHttpUrl = `https://github.com/${config.owner}/${config.name}.git`; |
| 37 | if (githubToken !== undefined) { |
| 38 | return addTokenToGitHttpsUrl(baseHttpUrl, githubToken); |
| 39 | } |
| 40 | return baseHttpUrl; |
| 41 | } |
| 42 | |
| 43 | /** Gets a Github URL that refers to a list of recent commits within a specified branch. */ |
| 44 | export function getListCommitsInBranchUrl(client: GitClient, branchName: string) { |
no test coverage detected