mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-30 19:07:25 +08:00
Accept dismissed approvals as valid reviews
"Dismiss stale reviews on new commits" changes APPROVED → DISMISSED when commits are pushed after approval. The review still happened, so count DISMISSED as a valid approval. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1cbb4c880d
commit
d1c1e52260
17
.github/workflows/detect-unreviewed-merge.yml
vendored
17
.github/workflows/detect-unreviewed-merge.yml
vendored
@ -41,24 +41,17 @@ jobs:
|
||||
|
||||
core.info(`Found PR #${pr.number}: ${pr.title}`);
|
||||
|
||||
// Determine effective approval state using latest review per reviewer
|
||||
// Check for approvals. DISMISSED counts because "dismiss stale reviews
|
||||
// on new commits" changes APPROVED → DISMISSED when commits are pushed
|
||||
// after approval — the review still happened.
|
||||
const reviews = await github.paginate(github.rest.pulls.listReviews, {
|
||||
owner,
|
||||
repo,
|
||||
pull_number: pr.number,
|
||||
});
|
||||
|
||||
const latestByReviewer = new Map();
|
||||
for (const r of reviews) {
|
||||
if (!r.user || r.state === 'COMMENTED') continue;
|
||||
const prev = latestByReviewer.get(r.user.login);
|
||||
if (!prev || new Date(r.submitted_at) > new Date(prev.submitted_at)) {
|
||||
latestByReviewer.set(r.user.login, r);
|
||||
}
|
||||
}
|
||||
|
||||
const hasApproval = Array.from(latestByReviewer.values()).some(
|
||||
r => r.state === 'APPROVED'
|
||||
const hasApproval = reviews.some(
|
||||
r => r.state === 'APPROVED' || r.state === 'DISMISSED'
|
||||
);
|
||||
if (hasApproval) {
|
||||
core.info('PR has an approving review — no action needed.');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user