infra: fix bot comments (#4367)

This commit is contained in:
Krzysztof Moch 2025-01-10 12:01:31 +01:00 committed by GitHub
parent c47d165668
commit eff8ea24af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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('<details>') &&
!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 = `
<details>