From ebe9db6538e05e82b06179500ee757a54eb17b0e Mon Sep 17 00:00:00 2001 From: Ryan Omasta Date: Mon, 8 Sep 2025 20:29:56 -0600 Subject: [PATCH] ci/github-script/labels: keep "needs reviewer" if only automated reviews (cherry picked from commit 32373aff1cb34410a10e381112d9d9c3fee362e3) --- ci/github-script/labels.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/github-script/labels.js b/ci/github-script/labels.js index d50dab436d8a..467d3b1f0ba7 100644 --- a/ci/github-script/labels.js +++ b/ci/github-script/labels.js @@ -93,6 +93,13 @@ module.exports = async ({ github, context, core, dry }) => { log('Last eval run', run_id ?? '') if (conclusion === 'success') { + // Check for any human reviews other than GitHub actions and other GitHub apps. + // Accounts could be deleted as well, so don't count them. + const humanReviews = reviews.filter( + (r) => + r.user && !r.user.login.endsWith('[bot]') && r.user.type !== 'Bot', + ) + Object.assign(prLabels, { // We only set this label if the latest eval run was successful, because if it was not, it // *could* have requested reviewers. We will let the PR author fix CI first, before "escalating" @@ -105,7 +112,7 @@ module.exports = async ({ github, context, core, dry }) => { '9.needs: reviewer': !pull_request.draft && pull_request.requested_reviewers.length === 0 && - reviews.length === 0, + humanReviews.length === 0, }) }