diff --git a/src/main.js b/src/main.js index 11e15f2..34b1d12 100644 --- a/src/main.js +++ b/src/main.js @@ -23,11 +23,11 @@ async function run() { owner, repo, pull_number - }) + }).data.reverse() console.log(`prReviews: ${JSON.stringify(prReviews, undefined, 2)}`) let reviews = [] - let filteredPrReviews = prReviews.data.reverse().filter(review => review.state !== "COMMENTED"); + let filteredPrReviews = prReviews.filter(review => review.state !== "COMMENTED"); filteredPrReviews.forEach(review => { const reviewer = review.user.login if (!reviews.find(r => r.reviewer === reviewer)) { @@ -36,6 +36,7 @@ async function run() { } } }); + console.log(`reviews: ${JSON.stringify(reviews, undefined, 2)}`) const approvedCount = reviews.filter(r => r.state === "APPROVED").length