From 04015e03aa38f89c0675c4c57838cbe5690fbbdb Mon Sep 17 00:00:00 2001 From: Wassim Metallaoui Date: Mon, 3 Jun 2024 13:27:34 -0500 Subject: [PATCH] fix: reverse the order on filtered --- src/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index bd00a58..60e637e 100644 --- a/src/main.js +++ b/src/main.js @@ -27,10 +27,10 @@ async function run() { console.log(`prReviews: ${JSON.stringify(prReviews.data.reverse(), undefined, 2)}`) let reviews = [] - let filteredPrReviews = prReviews.data.reverse().filter(review => review.state !== "COMMENTED"); + let filteredPrReviews = prReviews.data.filter(review => review.state !== "COMMENTED"); console.log(`filteredPrReviews: ${JSON.stringify(filteredPrReviews, undefined, 2)}`) - filteredPrReviews.forEach(review => { + filteredPrReviews.reverse().forEach(review => { const reviewer = review.user.login if (!reviews.find(r => r.reviewer === reviewer)) { if (!requestedReviewers.includes(reviewer)) {