workflows/bot: set "merge-bot eligible" label (#451312)

This commit is contained in:
Wolfgang Walther
2025-11-01 17:34:22 +00:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -112,7 +112,7 @@ module.exports = async ({ github, context, core, dry }) => {
const maintainers = await getMaintainerMap(pull_request.base.ref)
await handleMerge({
const merge_bot_eligible = await handleMerge({
github,
context,
core,
@@ -199,6 +199,7 @@ module.exports = async ({ github, context, core, dry }) => {
// The second pass will then read the result from the first pass and set the label.
'2.status: merge conflict':
merge_commit_sha_valid && !pull_request.merge_commit_sha,
'2.status: merge-bot eligible': merge_bot_eligible,
'12.approvals: 1': approvals.size === 1,
'12.approvals: 2': approvals.size === 2,
'12.approvals: 3+': approvals.size >= 3,

View File

@@ -251,6 +251,10 @@ async function handleMerge({
if (canMerge) break
}
// Returns a boolean, which indicates whether the PR is merge-bot eligible in principle.
// This is used to set the respective label in bot.js.
return result
}
module.exports = {