ci: fix "needs: reviewer" label being removed after self review

This commit is contained in:
Diogo Correia 2025-11-09 13:11:14 +00:00
parent 333bfb7c25
commit eb8cfea79d
No known key found for this signature in database
GPG key ID: 12B4F3AC9C065D08

View file

@ -210,7 +210,7 @@ module.exports = async ({ github, context, core, dry }) => {
} }
} }
// Check for any human reviews other than GitHub actions and other GitHub apps. // Check for any human reviews other than the PR author, GitHub actions and other GitHub apps.
// Accounts could be deleted as well, so don't count them. // Accounts could be deleted as well, so don't count them.
const reviews = ( const reviews = (
await github.paginate(github.rest.pulls.listReviews, { await github.paginate(github.rest.pulls.listReviews, {
@ -218,7 +218,11 @@ module.exports = async ({ github, context, core, dry }) => {
pull_number, pull_number,
}) })
).filter( ).filter(
(r) => r.user && !r.user.login.endsWith('[bot]') && r.user.type !== 'Bot', (r) =>
r.user &&
!r.user.login.endsWith('[bot]') &&
r.user.type !== 'Bot' &&
r.user.id !== pull_request.user?.id,
) )
const approvals = new Set( const approvals = new Set(