From eff8ea24af8d701cda184241127a739ba2883fa8 Mon Sep 17 00:00:00 2001 From: Krzysztof Moch Date: Fri, 10 Jan 2025 12:01:31 +0100 Subject: [PATCH] infra: fix bot comments (#4367) --- .github/scripts/validate.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/scripts/validate.js b/.github/scripts/validate.js index 78ed733c..fcc67132 100644 --- a/.github/scripts/validate.js +++ b/.github/scripts/validate.js @@ -267,11 +267,15 @@ const hidePreviousComments = async ({github, context}) => { issue_number: context.payload.issue.number, }); - const botComments = comments.data.filter( - (comment) => comment.user.type === 'Bot', + // Filter for bot comments that aren't already hidden + const unhiddenBotComments = comments.data.filter( + (comment) => + comment.user.type === 'Bot' && + !comment.body.includes('
') && + !comment.body.includes('Previous bot comment') ); - for (const comment of botComments) { + for (const comment of unhiddenBotComments) { // Don't format string - it will broke the markdown const hiddenBody = `