infra: fix bot comments (#4367)
This commit is contained in:
parent
c47d165668
commit
eff8ea24af
10
.github/scripts/validate.js
vendored
10
.github/scripts/validate.js
vendored
@ -267,11 +267,15 @@ const hidePreviousComments = async ({github, context}) => {
|
|||||||
issue_number: context.payload.issue.number,
|
issue_number: context.payload.issue.number,
|
||||||
});
|
});
|
||||||
|
|
||||||
const botComments = comments.data.filter(
|
// Filter for bot comments that aren't already hidden
|
||||||
(comment) => comment.user.type === 'Bot',
|
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
|
// Don't format string - it will broke the markdown
|
||||||
const hiddenBody = `
|
const hiddenBody = `
|
||||||
<details>
|
<details>
|
||||||
|
Loading…
Reference in New Issue
Block a user