implement mergify rules for release branches (#10135)
[cabal.git] / .github / mergify.yml
bloba7336e6a6c7db9c65d00797ba455017a9e063c64
1 # Note: We do not use the rebase strategy to merge PRs, because that
2 # loses information needed by changelog-d to associate commits with PRs.
4 pull_request_rules:
6   # implementing PR delay logic: apply a label after 2 days of inactivity
7   # the label will allow Mergify to merge (see #8442, #8448)
8   - actions:
9       label:
10         add:
11           - merge delay passed
12     name: Wait for 2 days before validating merge
13     conditions:
14       - updated-at<2 days ago
15       - or:
16         - label=merge me
17         - label=squash+merge me
18         - label=merge+no rebase
19       - '#approved-reviews-by>=2'
21   # rebase+merge strategy
22   - actions:
23       queue:
24         name: default
25     name: Put pull requests in the rebase+merge queue
26     conditions:
27       - base=master
28       - label=merge me
29       - label=merge delay passed
30       - '#approved-reviews-by>=2'
31       - '-label~=^blocked:'
33   # merge+squash strategy
34   - actions:
35       queue:
36         name: squash-merge
37     name: Put pull requests in the squash+merge queue
38     conditions:
39       - base=master
40       - label=squash+merge me
41       - label=merge delay passed
42       - '#approved-reviews-by>=2'
43       - '-label~=^blocked:'
45   # merge+no rebase strategy
46   - actions:
47       merge:
48         method: merge
49     name: Merge "merge+no rebase" pull requests directly (without a queue)
50     conditions:
51       - base=master
52       - label=merge+no rebase
53       - label=merge delay passed
54       - '#approved-reviews-by>=2'
55       - '-label~=^blocked:'
57   # merge strategy for release branches
58   - actions:
59       queue:
60         name: default
61     name: Put release branch pull requests in the rebase+merge queue
62     conditions:
63       - label=merge me
64       - base!=master
65       - -body~=backport
66       - '#approved-reviews-by>=2'
67       - '-label~=^blocked:'
69   # merge+squash strategy for release branches
70   - actions:
71       queue:
72         name: squash-merge
73     name: Put release branch pull requests in the squash+merge queue
74     conditions:
75       - base!=master
76       - label=squash+merge me
77       - -body~=backport
78       - '#approved-reviews-by>=2'
79       - '-label~=^blocked:'
81   # merge strategy for backports: require 1 approver instead of 2
82   - actions:
83       queue:
84         name: default
85     name: Put backports in the rebase+merge queue
86     conditions:
87       - label=merge me
88       - base!=master
89       - body~=backport
90       - '#approved-reviews-by>=1'
91       - '-label~=^blocked:'
93   # merge+squash strategy for backports: require 1 approver instead of 2
94   - actions:
95       queue:
96         name: squash-merge
97     name: Put backports in the squash+merge queue
98     conditions:
99       - label=squash+merge me
100       - base!=master
101       - body~=backport
102       - '#approved-reviews-by>=1'
103       - '-label~=^blocked:'
105   # backports should be labeled as such
106   - actions:
107       label:
108         add:
109           - backport
110     name: Label backports as such
111     conditions:
112       - body~=automatic backport
114 queue_rules:
115   # Mergify now requires different queues for different strategies
116   - name: default
117     update_bot_account: Mikolaj
118     merge_method: merge
119     update_method: rebase
121   - name: squash-merge
122     update_bot_account: Mikolaj
123     merge_method: squash
124     update_method: merge