Skip to content

Commit

Permalink
infra: fix bot comments (#4367)
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofMoch authored Jan 10, 2025
1 parent c47d165 commit eff8ea2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/scripts/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit eff8ea2

Please sign in to comment.