Skip to content

Commit

Permalink
fix: want to see the reversed PR's in the log out
Browse files Browse the repository at this point in the history
  • Loading branch information
wassimk committed Jun 3, 2024
1 parent f84d8d4 commit 37da562
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -36,6 +36,7 @@ async function run() {
}
}
});

console.log(`reviews: ${JSON.stringify(reviews, undefined, 2)}`)

const approvedCount = reviews.filter(r => r.state === "APPROVED").length
Expand Down

0 comments on commit 37da562

Please sign in to comment.