From 7a74549a8506b563f2b4bfd860dacf15b0e7a33e Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Mon, 26 Jan 2026 19:32:33 -0500 Subject: [PATCH] ci/github-script/reviews: detect reviews belonging to commits.js See comment, but TLDR this is for backwards-compatibility. (See 479628, where it failed to dismiss after fixing.) We don't bother with `prepare.js` because it always errors (and so should never be dismissed). I have simply added the needed comments to each of `check-target-branch.js`'s pre-existing reviews, because there are so few. --- ci/github-script/reviews.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci/github-script/reviews.js b/ci/github-script/reviews.js index 0dacaa814e62..7041fdae1f10 100644 --- a/ci/github-script/reviews.js +++ b/ci/github-script/reviews.js @@ -66,7 +66,13 @@ async function dismissReviews({ github, context, core, dry, reviewKey }) { changesRequestedReviews.every( (review) => commentResolvedRegex.test(review.body) || - (reviewKey && reviewKeyRegex.test(review.body)), + (reviewKey && reviewKeyRegex.test(review.body)) || + // If we are called by check-commits and the review body is clearly + // from `commits.js`, then we can safely dismiss the review. + // This helps with pre-existing reviews (before the comments were added). + (reviewKey && + reviewKey === 'check-commits' && + review.body.includes('PR / Check / cherry-pick')), ) ) { reviewsToDismiss = changesRequestedReviews