File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -313,10 +313,23 @@ export class GitHubAPI {
313
313
return response . json ( )
314
314
}
315
315
316
+ /**
317
+ * Fetches all comments from a Pull Request on GitHub.
318
+ *
319
+ * This function retrieves all the comments associated with a given pull request.
320
+ * It makes a request to the GitHub API endpoint that returns all comments for the
321
+ * specified pull request and repository.
322
+ *
323
+ * https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#list-issue-comments-for-a-repository
324
+ *
325
+ * @returns {Promise<GitHubIssueComment[]> } A promise that resolves to an array of GitHub issue comments.
326
+ *
327
+ */
316
328
getPullRequestComments = async ( ) : Promise < GitHubIssueComment [ ] > => {
329
+ const pr = await this . getPullRequestInfo ( )
317
330
const repo = this . repoMetadata . repoSlug
318
- const prID = this . repoMetadata . pullRequestID
319
- return await this . getAllOfResource ( `repos/${ repo } /issues/ ${ prID } /comments` )
331
+ const owner = pr . base . repo . owner . login
332
+ return await this . getAllOfResource ( `repos/${ owner } / ${ repo } /issues /comments` )
320
333
}
321
334
322
335
getPullRequestInlineComments = async (
You can’t perform that action at this time.
0 commit comments