Unverified Commit 646010d9 authored by Matt Sturgeon's avatar Matt Sturgeon Committed by GitHub
Browse files

ci: fix "needs: reviewer" label being removed after self review (#460048)

parents 09a722cd eb8cfea7
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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.
    const reviews = (
      await github.paginate(github.rest.pulls.listReviews, {
@@ -218,7 +218,11 @@ module.exports = async ({ github, context, core, dry }) => {
        pull_number,
      })
    ).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(