* Fetch a pull request review comment (i.e. a comment that was posted as part * of a review of a pull request). * * @param owner The owner of the repository * @param name The name of the repository * @param commentId The ID of the comment * * @returns The comment if it was found
(
owner: string,
name: string,
commentId: string
)
| 944 | * occurred. |
| 945 | */ |
| 946 | public async fetchPullRequestReviewComment( |
| 947 | owner: string, |
| 948 | name: string, |
| 949 | commentId: string |
| 950 | ): Promise<IAPIComment | null> { |
| 951 | try { |
| 952 | const response = await this.ghRequest( |
| 953 | 'GET', |
| 954 | `repos/${owner}/${name}/pulls/comments/${commentId}` |
| 955 | ) |
| 956 | if (response.status === HttpStatusCode.NotFound) { |
| 957 | log.warn( |
| 958 | `fetchPullRequestReviewComment: '${owner}/${name}/pulls/comments/${commentId}' returned a 404` |
| 959 | ) |
| 960 | return null |
| 961 | } |
| 962 | return await parsedResponse<IAPIComment>(response) |
| 963 | } catch (e) { |
| 964 | log.warn( |
| 965 | `fetchPullRequestReviewComment: an error occurred for '${owner}/${name}/pulls/comments/${commentId}'`, |
| 966 | e |
| 967 | ) |
| 968 | return null |
| 969 | } |
| 970 | } |
| 971 | |
| 972 | /** Fetch a repo by its owner and name. */ |
| 973 | public async fetchRepository( |
no test coverage detected