Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 293536c

Browse files
committed
Don't close PRs waiting for reviews
1 parent 1a64137 commit 293536c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/pr-info.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,10 @@ function getReviews(prInfo: PR_repository_pullRequest) {
460460
continue;
461461
}
462462
if (r.state === "CHANGES_REQUESTED") {
463-
reviews.push({ type: "changereq", reviewer, date });
463+
if (!prInfo.reviewRequests?.nodes?.some(reviewRequest =>
464+
reviewRequest?.requestedReviewer
465+
&& "login" in reviewRequest.requestedReviewer
466+
&& sameUser(reviewRequest.requestedReviewer.login, reviewer))) reviews.push({ type: "changereq", reviewer, date });
464467
continue;
465468
}
466469
if (r.state !== "APPROVED") continue;

src/queries/pr-query.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ query PR($pr_number: Int!) {
5252
}
5353
}
5454
55+
reviewRequests(last: 100) {
56+
nodes {
57+
requestedReviewer {
58+
... on Actor {
59+
login
60+
}
61+
}
62+
}
63+
}
64+
5565
reviews(last: 100) {
5666
nodes {
5767
author {

0 commit comments

Comments
 (0)