-
Notifications
You must be signed in to change notification settings - Fork 48
179 lines (163 loc) · 4.38 KB
/
mergiify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
pull_request_rules:
- name: auto-merge
description: automatic merge for main with >= 1 approved reviews, all requested reviews have given feedback, not held, and CI is successful
conditions:
- "#approved-reviews-by>=1"
- "#review-requested=0"
- "#changes-requested-reviews-by=0"
- or:
- base=main
- base~=^release-
- label!=hold
- label!=do-not-merge
- label!=needs-rebase
- check-success=DCO
# The files conditions regex should match the globs in workflow files
# If workflow configuration files in .github/ are changed, the actionlint check must pass
- or:
- and:
- check-success=actionlint
- or:
- files~=^\.github/(actions|workflows)/.*\.ya?ml$
- files~=^\.github/workflows/actionlint\.
- and:
- -files~=^\.github/(actions|workflows)/.*\.ya?ml$
- -files~=^\.github/workflows/actionlint\.
# e2e workflow
- or:
- and:
- check-success=e2e
- or:
- files~=\.py$
- files=pyproject.toml
- files~=^requirements.*\.txt$
- files=.github/workflows/e2e.yml
- and:
- -files~=\.py$
- -files=pyproject.toml
- -files~=^requirements.*\.txt$
- -files=.github/workflows/e2e.yml
# lint must pass if files change that would trigger this job
- or:
- and:
- check-success=lint-workflow-complete
- or:
# see .github/workflows/lint.yml and test.yml
- files~=\.py$
- files=pyproject.toml
- files~=^requirements.*\.txt$
- files=tox.ini
- files~=^scripts/[^/]+\.sh$
- files=.github/workflows/lint.yml
- and:
- -files~=\.py$
- -files=pyproject.toml
- -files~=^requirements.*\.txt$
- -files=tox.ini
- -files~=^scripts/[^/]+\.sh$
- -files=.github/workflows/lint.yml
actions:
merge:
method: merge
delete_head_branch:
- name: label-cicd
description: Automatically apply CI/CD label
conditions:
- or:
- files=.github/mergify.yml
- files~=^\.github/(actions|workflows)/
- files=scripts/ruff.sh
- files=.pre-commit-config.yaml
- files=.pylintrc
- files~=^\.spellcheck[^/]+$
- files=tox.ini
- files=.markdownlint-cli2.yaml
actions:
label:
add:
- CI/CD
- name: label-documentation
description: Automatically apply documentation label
conditions:
- or:
- files~=^[^/]+\.md$
actions:
label:
add:
- documentation
- name: label-testing
description: Automatically apply testing label
conditions:
- or:
- files~=^tests/
- files=tox.ini
actions:
label:
add:
- testing
- name: ping author on conflicts and add 'needs-rebase' label
conditions:
- conflict
- -closed
actions:
label:
add:
- needs-rebase
comment:
message: |
This pull request has merge conflicts that must be resolved before it can be
merged. @{{author}} please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork
- name: remove 'needs-rebase' label when conflict is resolved
conditions:
- -conflict
- -closed
actions:
label:
remove:
- needs-rebase
- name: release-branch-label
description: Automatically apply the release-branch label to release branch PRs
conditions:
- base~=^release-
actions:
label:
add:
- release-branch
- name: Apply ci-failure label if any CI checks have failed
conditions:
- "#check-failure>0"
actions:
label:
add:
- ci-failure
- name: Remove ci-failure label if no failures are present
conditions:
- "#check-failure=0"
actions:
label:
remove:
- ci-failure
- name: Apply 'one-approval' label if one of the maintainer approved the PR
conditions:
- "#approved-reviews-by=1"
actions:
label:
add:
- one-approval
- name: Remove 'one-approval' label if the approval was reset
conditions:
- "#approved-reviews-by!=1"
actions:
label:
remove:
- one-approval
- name: label-dependencies
description: Automatically apply dependencies label
conditions:
- or:
- files~=^requirements.*\.txt$
- files~=^requirements/
actions:
label:
add:
- dependencies