Fetch a repo by its owner and name.
(
owner: string,
name: string
)
| 971 | |
| 972 | /** Fetch a repo by its owner and name. */ |
| 973 | public async fetchRepository( |
| 974 | owner: string, |
| 975 | name: string |
| 976 | ): Promise<IAPIFullRepository | null> { |
| 977 | try { |
| 978 | const response = await this.ghRequest('GET', `repos/${owner}/${name}`) |
| 979 | if (response.status === HttpStatusCode.NotFound) { |
| 980 | log.warn(`fetchRepository: '${owner}/${name}' returned a 404`) |
| 981 | return null |
| 982 | } |
| 983 | return await parsedResponse<IAPIFullRepository>(response) |
| 984 | } catch (e) { |
| 985 | log.warn(`fetchRepository: an error occurred for '${owner}/${name}'`, e) |
| 986 | return null |
| 987 | } |
| 988 | } |
| 989 | |
| 990 | /** |
| 991 | * Fetch info needed to clone a repository. That includes: |
no test coverage detected