Skip to content

Commit

Permalink
Prevent merging PRs directly in main with a failing Mergeable check, …
Browse files Browse the repository at this point in the history
…except when an `mergeable:force-allow` label is present.

This serves to prevent accidental PR merges outside of Copybara, but is not actually enforced by branch protection.

PiperOrigin-RevId: 492255443
  • Loading branch information
zhangskz authored and copybara-github committed Dec 1, 2022
1 parent 527a277 commit e66e69d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/mergeable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
mergeable:
pull_requests:
label:
and:
- must_exclude:
regex: '^disposition/DO NOT MERGE'
message: 'Pull request marked not mergeable'
- must_include:
regex: 'mergeable:force-allow'
message: 'Pull requests should not be merged directly and should instead '
'be handled by Copybara.\n\n'
'To enable Github merges, add the `mergeable:force-allow` label. This should almost '
'never be used except for releases or as a break glass measure '
'after discussing with the team.'

0 comments on commit e66e69d

Please sign in to comment.