| Oct | NOV | Dec |
| 18 | ||
| 2018 | 2019 | 2020 |
COLLECTED BY
Collection: Common Crawl
pull_request_rules: - name: automatic merge when CI passes and 2 reviews conditions: - "#approved-reviews-by>=2" - status-success=Travis CI - Pull Request - base=master actions: merge: method: mergeYou can tweak as fine as you want. For example, many users like to use a label such as
work-in-progress to indicate that a pull request is not ready to be
merged — even if’s approved.
pull_request_rules: - name: automatic merge when CI passes and 2 reviews conditions: - "#approved-reviews-by>=2" - status-success=Travis CI - Pull Request - base=master - label!=work-in-progress actions: merge: method: mergeIf you are already using the GitHub Branch Protection system. You can just use:
pull_request_rules: - name: automatic merge when GitHub branch protection passes conditions: - base=master actions: merge: method: merge
pull_request_rules: - name: backport patches to stable branch conditions: - base=master - label=backport-to-stable actions: backport: branches: - stable
pull_request_rules: - name: delete head branch after merge conditions: [] actions: delete_head_branch: {}
master.
To automate the merge in this case, you could write some rules along those:
pull_request_rules: - name: automatic merge for master when reviewed and CI passes conditions: - "status-success=ci/circleci: my_testing_job" - "#approved-reviews-by>=2" - base=master actions: merge: method: merge - name: automatic merge for stable branches conditions: - "status-success=ci/circleci: my_testing_job" - "#approved-reviews-by>=1" - base~=^stable/ actions: merge: method: merge
label:
pull_request_rules: - name: automatic merge for master when reviewed and CI passes conditions: - status-success=Travis CI - Pull Request - "#approved-reviews-by>=2" - base=master - label=ready-to-merge actions: merge: method: mergeAs soon as the pull request has been approved by 2 contributors and gets the label
ready-to-be-merged, the pull request will be merged by Mergify.
On the other hand, some developers wants an option to disable the automatic
merge feature with a label. This can be useful to indicate that a pull request
labelled as work-in-progress should not be merged:
pull_request_rules: - name: automatic merge for master when reviewed and CI passes conditions: - status-success=continuous-integration/travis-ci/pr - "#approved-reviews-by>=2" - base=master - label!=work-in-progress actions: merge: method: mergeIn that case, if a pull request gets labelled with
work-in-progress, it
won’t be merged, even if approved by 2 contributors and having Travis CI
passing.
pull_request_rules: - name: remove outdated reviews conditions: - base=master actions: dismiss_reviews: {}
review-requested, changes-requested-reviews-by, and
commented-reviews-by will all be 0. You also want to make sure there’s at
least one positive review, obviously.
pull_request_rules: - name: merge when all requested reviews are valid conditions: - "#approved-reviews-by>=1" - "#review-requested=0" - "#changes-requested-reviews-by=0" - "#commented-reviews-by=0" actions: merge: method: mergeNote that if a requested review is dismissed, then it doesn’t count as a review that would prevent the merge.
files to specify the file and #files to
limit the number of files.
This tweak is useful when you want Mergify to merge only data files which can be
validated by the script, linter, etc.
The below sample merges only if both or either one of data1.json and
data2.json file is changed and passes Circle CI’s validation tests:
pull_request_rules: - name: automatic merge on CircleCI success if data1.json is changed conditions: - "status-success=ci/circleci: validate" - base=master - files=data1.json - "#files=1" actions: merge: method: merge strict: true - name: automatic merge on CircleCI success if list2.json is changed conditions: - "status-success=ci/circleci: validate" - base=master - files=data2.json - "#files=1" actions: merge: method: merge strict: true
Travis CI- Pull Request is used as the
CI check name here, but it can be anything that you need.
pull_request_rules: - name: automatic merge for Dependabot pull requests conditions: - author=dependabot[bot] - status-success=Travis CI - Pull Request actions: merge: method: merge
pull_request_rules: - name: automatic merge for Greenkeeper pull requests conditions: - author=greenkeeper[bot] - status-success=Travis CI - Pull Request - status-sucess=greenkeeper/verify actions: merge: method: merge
pull_request_rules: - name: automatic merge for Renovate pull requests conditions: - author=renovate[bot] - status-success=Travis CI - Pull Request actions: merge: method: merge
pull_request_rules: - name: automatic merge for PyUp pull requests conditions: - author=pyup-bot - status-success=Travis CI - Pull Request actions: merge: method: merge
pull_request_rules: - name: automatic merge for ImgBot pull requests conditions: - author=imgbot[bot] - status-success=Travis CI - Pull Request actions: merge: method: merge©2019, Mergify.io.