Skip to content

Commit

Permalink
all non-push reviews are ignored by labels
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-fidd committed Aug 8, 2024
1 parent b26a1a1 commit c5c21a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/classes/PullRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default class PullRequest {
).data.map(u => u.id);

const latestReviewsObj: {
[key: number]: { state: string; time: number; user: number };
[key: number]: { state: string; time: number };
} = {};

for (const r of reviews) {
Expand All @@ -142,10 +142,11 @@ export default class PullRequest {
const user = r.user.id;
const time = new Date(r.submitted_at).getTime();

if (!pushUsers.includes(user)) continue;

const review = {
state: r.state,
time,
user,
};

if (!latestReviewsObj[user]) {
Expand All @@ -167,7 +168,7 @@ export default class PullRequest {
}

const approvingReviews = latestReviews.filter(
r => r.state === 'APPROVED' && pushUsers.includes(r.user),
r => r.state === 'APPROVED',
).length;
const requiredReviews = await this.getRequiredReviews();

Expand Down

0 comments on commit c5c21a3

Please sign in to comment.