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:
@@ -112,7 +112,7 @@ module.exports = async ({ github, context, core, dry }) => {
|
|||||||
|
|
||||||
const maintainers = await getMaintainerMap(pull_request.base.ref)
|
const maintainers = await getMaintainerMap(pull_request.base.ref)
|
||||||
|
|
||||||
await handleMerge({
|
const merge_bot_eligible = await handleMerge({
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
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.
|
// The second pass will then read the result from the first pass and set the label.
|
||||||
'2.status: merge conflict':
|
'2.status: merge conflict':
|
||||||
merge_commit_sha_valid && !pull_request.merge_commit_sha,
|
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: 1': approvals.size === 1,
|
||||||
'12.approvals: 2': approvals.size === 2,
|
'12.approvals: 2': approvals.size === 2,
|
||||||
'12.approvals: 3+': approvals.size >= 3,
|
'12.approvals: 3+': approvals.size >= 3,
|
||||||
|
|||||||
@@ -251,6 +251,10 @@ async function handleMerge({
|
|||||||
|
|
||||||
if (canMerge) break
|
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 = {
|
module.exports = {
|
||||||
|
|||||||
Reference in New Issue
Block a user