Skip to content

Commit

Permalink
feat: Add more supported events to baseRef validator
Browse files Browse the repository at this point in the history
- The auto-merge workflow (using the `merge` action) listens to the
  `status.*` and `check_suite.*` events in addition to the more standard
  `pull-request.*` and `pull_request_review.*`.
  This workflow relies on branch protections to stop the merge while
  the check_suite is running.
  Since branch protections are usually setup **only** only on the
  default branch it means PRs that are targetting none-default
  branches are auto-merged by the workflow sometime before the check
  suite has even completed (if `check_suite.*` is used).
- Add `status.*` and `check_suite.*` event support to the baseRef
  validator so that auto-merge can be limited to the default branch.
  • Loading branch information
abid-mujtaba committed Nov 25, 2021
1 parent f7f037b commit b3eaec3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CHANGELOG
=====================================
| November 25, 2021: feat: Add more supported events to baseRef validator `#395 <https://github.com/mergeability/mergeable/pull/395>` _
| October 19, 2021 : feat: Add validator approval option to exclude users `#594 <https://github.com/mergeability/mergeable/pull/594>`_
| October 12, 2021 : feat: Add boolean option for payload filter `#583 <https://github.com/mergeability/mergeable/pull/583>`_
| September 27, 2021 : fix: use node version 14.17.6 for the release action `#591 <https://github.com/mergeability/mergeable/pull/591>`_
Expand Down
2 changes: 1 addition & 1 deletion docs/validators/baseRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Simple example:
Supported Events:
::

'pull_request.*', 'pull_request_review.*'
'pull_request.*', 'pull_request_review.*', 'check_suite.*', 'status.*'
4 changes: 3 additions & 1 deletion lib/validators/baseRef.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ class BaseRef extends Validator {
super('baseRef')
this.supportedEvents = [
'pull_request.*',
'pull_request_review.*'
'pull_request_review.*',
'check_suite.*',
'status.*'
]
this.supportedSettings = {
must_include: {
Expand Down

0 comments on commit b3eaec3

Please # to comment.