Do not consider PR in test if there is any review requesting changes
This commit is contained in:
parent
8e0298c830
commit
d4f5a453f8
|
@ -35,7 +35,10 @@ async function getReviewApprovalState(github, payload) {
|
|||
const ghreviews = await github.pullRequests.getReviews({owner: ownerName, repo: repoName, number: prNumber})
|
||||
const approvedReviews = ghreviews.data.filter(review => review.state === 'APPROVED')
|
||||
if (approvedReviews.length >= 2) {
|
||||
return 'approved'
|
||||
const reviewsWithChangesRequested = ghreviews.data.filter(review => review.state === 'CHANGES_REQUESTED')
|
||||
if (reviewsWithChangesRequested.length == 0) {
|
||||
return 'approved'
|
||||
}
|
||||
}
|
||||
|
||||
return 'pending'
|
||||
|
|
Loading…
Reference in New Issue