diff --git a/src/shared/pr-comment-audience.ts b/src/shared/pr-comment-audience.ts index 4736ab5c372..7542c17d851 100644 --- a/src/shared/pr-comment-audience.ts +++ b/src/shared/pr-comment-audience.ts @@ -55,7 +55,12 @@ export function getPRCommentAudienceCounts( comments: readonly PRComment[], botAuthorOverrides?: ReadonlySet ): Record { - const bot = comments.filter((comment) => isBotPRComment(comment, botAuthorOverrides)).length + let bot = 0 + comments.forEach((comment) => { + if (isBotPRComment(comment, botAuthorOverrides)) { + bot += 1 + } + }) return { all: comments.length, human: comments.length - bot, bot } }