1 of 13

Automate your Pull Requests

Julien Danjou — Founder @ Mergify�GitHub Paris Meetup @ Doctolib

26th March 2019

2 of 13

The Process

Merge?

3 of 13

The Problem

4 of 13

The Solution

5 of 13

In Practice

pull_request_rules:

- name: automatic merge

conditions:

- '#approved-reviews-by>=2'

- status-success=Travis CI - PR

actions:

merge:

method: merge

No need to teach “merging rules” to your contributors:

.mergify.yml is your policy

6 of 13

7 of 13

8 of 13

Features

Delete Head Branch

Dismiss Review

Close

Comment

Merge

Label

Actions

9 of 13

Use Case: Automatic Backport

Merge

base=master

backport-to-prod

Backport

Copy

(backport)

Merge

Open

base=master

backport-to-prod

Merged

base=production

Open

base=production

Merged

10 of 13

Automatic Merge from Bots

pull_requests_rules:

- name: automatic merge

conditions:

- '#approved-reviews-by>=1'

- status-success=Travis CI

actions:

merge:

method: rebase

- name: backport to production

conditions:

- label=backport-to-prod

actions:

backport:

branches:

- production

- name: automerge production

conditions:

- author=mergify[bot]

- base=production

- status-success=Travis CI

actions:

merge:

method: rebase

Greenkeeper

Dependabot

11 of 13

Strict Workflow

PR#1

PR#2

PR#1

PR#2

master

12 of 13

Strict Workflow

PR#1

PR#2

PR#1

PR#2

Merge

Rebase

PR#1

pull_requests_rules:

- name: automatic merge

conditions:

- '#approved-reviews-by>=1'

- status-success=Travis CI

actions:

merge:

method: merge

strict: true

13 of 13

mergify.io