Skip to content

Commit 64f8b73

Browse files
authored
ci: Let newer Codex findings override approval
1 parent e817eb8 commit 64f8b73

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎.github/workflows/codex-review-gate.yml‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,15 @@ jobs:
442442
const reviewInProgress = codexReactions.some(
443443
(reaction) => reaction.content === 'eyes',
444444
);
445+
const finding = terminal
446+
.filter((item) => item.kind === 'findings')
447+
.sort((a, b) => b.at - a.at)[0];
445448
446-
if (allowApproval && approvalReaction) {
449+
if (
450+
allowApproval &&
451+
approvalReaction &&
452+
(!finding || approvalReaction.at >= finding.at)
453+
) {
447454
return {
448455
terminal: approvalReaction,
449456
quota: quotas[0] || null,
@@ -459,9 +466,6 @@ jobs:
459466
};
460467
}
461468
462-
const finding = terminal
463-
.filter((item) => item.kind === 'findings')
464-
.sort((a, b) => b.at - a.at)[0];
465469
return {
466470
terminal: finding || null,
467471
quota: null,

0 commit comments

Comments
 (0)