- add capability to fetch review comments and use them as part of the target template

- allow array syntax to be used as part of reviewers, approvers, assignees
This commit is contained in:
Mike Penz
2022-12-09 13:03:23 +00:00
committed by GitHub
parent 6846cd4c4f
commit 38aabea998
5 changed files with 194 additions and 10 deletions
+14
View File
@@ -95,6 +95,7 @@ export class ReleaseNotes {
private async getMergedPullRequests(octokit: Octokit): Promise<[DiffInfo, PullRequestInfo[]]> {
const {owner, repo, includeOpen, fetchReviewers, configuration} = this.options
const fetchReviews = true // TEMPORARY!!
const diffInfo = await this.getCommitHistory(octokit)
const commits = diffInfo.commitInfo
@@ -198,6 +199,19 @@ export class ReleaseNotes {
core.debug(`️ Fetching reviewers was disabled`)
}
if (fetchReviews) {
core.info(`️ Fetching reviews was enabled`)
// update PR information with reviewers who approved
for (const pr of finalPrs) {
await pullRequestsApi.getReviews(owner, repo, pr)
if ((pr.reviews?.length || 0) > 0) {
core.info(`️ Retrieved ${pr.reviews?.length || 0} review(s) for PR ${owner}/${repo}/#${pr.number}`)
}
}
} else {
core.debug(`️ Fetching reviews was disabled`)
}
return [diffInfo, finalPrs]
}