fix(ci): honour a duplicate-notice thumbs down from anyone

The notice tells every reader that a thumbs down keeps the issue open, but the
sweep only counted the reaction when it came from the issue author. A maintainer
or another affected user could follow the instruction exactly and still watch the
issue close, which made the notice a promise the sweep did not keep.

Any thumbs down now spares the issue. That buys back nothing an abuser did not
already have: a plain comment stops the clock for anyone, so restricting the
reaction only ever penalised people who did what they were told.

Drops the issue and reaction author fields, since nothing reads them now.
This commit is contained in:
mubashir1osmani 2026-08-26 15:35:36 -04:00
parent f4542d9605
commit f118511f55

View file

@ -9,7 +9,6 @@ declare global {
interface GitHubIssue {
number: number;
title: string;
user: { login: string };
labels: { name: string }[];
}
@ -21,7 +20,6 @@ interface GitHubComment {
}
interface GitHubReaction {
user: { login: string };
content: string;
}
@ -240,17 +238,17 @@ async function autoCloseDuplicates(): Promise<void> {
`[DEBUG] Issue #${issue.number} - duplicate comment has ${reactions.length} reactions`,
);
const authorThumbsDown = reactions.some(
(reaction) =>
reaction.user.login === issue.user.login && reaction.content === "-1",
);
// Any thumbs down, not just the author's. The notice tells every reader that a
// 👎 keeps the issue open, and anyone can already stop the clock by commenting,
// so honouring only the author would make the notice a lie without buying safety.
const thumbsDown = reactions.some((reaction) => reaction.content === "-1");
console.log(
`[DEBUG] Issue #${issue.number} - author thumbs down reaction: ${authorThumbsDown}`,
`[DEBUG] Issue #${issue.number} - thumbs down reaction: ${thumbsDown}`,
);
if (authorThumbsDown) {
if (thumbsDown) {
console.log(
`[DEBUG] Issue #${issue.number} - author disagreed with duplicate detection, skipping`,
`[DEBUG] Issue #${issue.number} - someone disagreed with duplicate detection, skipping`,
);
continue;
}