workflows/bot: set "merge-bot eligible" label

This makes it more visible which PRs are merge-bot eligible, by setting
a label respectively.
This commit is contained in:
Wolfgang Walther 2025-10-12 13:40:49 +02:00
parent ba3293a128
commit 00e7b934fb
No known key found for this signature in database
GPG key ID: B39893FA5F65CAE1
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 = {