chore: fix detection of bot comments after migrating to graphql (#35626)

This commit is contained in:
Yury Semikhatsky 2025-04-15 14:28:11 -07:00 committed by GitHub
parent 224667e9ff
commit 61fc320053
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -65,6 +65,7 @@ class GHAMarkdownReporter extends MarkdownReporter {
id
body
author {
__typename
login
}
}
@ -73,8 +74,10 @@ class GHAMarkdownReporter extends MarkdownReporter {
}
}
`);
const comments = data.repository.pullRequest?.comments.nodes?.filter(
comment => comment?.author?.login === 'github-actions[bot]' && comment.body?.includes(magicComment));
const comments = data.repository.pullRequest?.comments.nodes?.filter(comment =>
comment?.author?.__typename === 'Bot' &&
comment?.author?.login === 'github-actions' &&
comment.body?.includes(magicComment));
const prId = data.repository.pullRequest?.id;
if (!comments?.length)
return prId;