Skip to content

Commit 45c4236

Browse files
authored
Fix review state tracking logic
State tracking logic breaks when a reviewer adds a comment after an approval
1 parent 5d7f165 commit 45c4236

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/codeowner_review_status.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ jobs:
6060
pull_number: number,
6161
});
6262
63-
// Track latest review state per user
64-
const latestReviews = new Map();
63+
// Track latest review state per user (ignore commented state)
6564
reviews.forEach(review => {
65+
if (review.state === 'COMMENTED') return;
6666
const existing = latestReviews.get(review.user.login);
6767
if (!existing || review.submitted_at > existing.submitted_at) {
6868
latestReviews.set(review.user.login, review);
@@ -200,4 +200,4 @@ jobs:
200200
description: statusDescription,
201201
context: 'Documentation Team Approval'
202202
});
203-
console.log(`Created commit status: ${statusState} - ${statusDescription}`);
203+
console.log(`Created commit status: ${statusState} - ${statusDescription}`);

0 commit comments

Comments
 (0)