mergeable
mergeable copied to clipboard
PR is getting merged before pipeline starts
If all criteria pass, the pr is merged even before the pipeline has started. Is there any way to check if the pipeline already ran?
mergeable:
- when: pull_request.*, pull_request_review.*
validate:
- do: title
# Do not merge WIP.
must_exclude:
regex: 'wip|work in progress'
- do: label
# Do not merge WIP.
must_exclude:
regex: 'wip|work in progress'
# Do not merge WIP.
- do: label
must_exclude:
regex: 'DO NOT MERGE'
# At least two senior approve
- do: approvals
min:
count: 1
limit:
users:
[
'user1',
'user2'
]
# It must have a milestone
- do: milestone
begins_with:
match: 'PR Merge List Order for'
# Check QA approve or if no QA review is needed
- do: or
validate:
- do: label
must_include:
regex: 'NoEmbeddedQA'
- do: approvals
min:
count: 1
limit:
users: ['user1', 'user2]
pass:
- do: merge
merge_method: 'squash'
- do: checks
status: 'success'```
@JerryMacedoCastro IIRC if you have the other checks as required as part of a protected branch, it won't merge until those are green. Other than that, I am not sure how to prevent this from happening.
IIRC
Is there a way to add a check for other pipelines? I mean, one of the checks is Danger JS https://danger.systems/js/. Can we add a check to wait until danger is completed?
currently, no.
@JerryMacedoCastro I think so other ways like putting a label if a danger check is not done (danger-check-not-done). The mergeable check should check for that label if still exists then it must not pass the merge action.
@JerryMacedoCastro or using comments