-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.mergify.yml
More file actions
157 lines (148 loc) · 5.32 KB
/
Copy path.mergify.yml
File metadata and controls
157 lines (148 loc) · 5.32 KB
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
queue_rules:
# Dosubot: only needs quality (fmt + clippy) to pass
- name: dosubot
merge_method: squash
queue_conditions:
- base = main
- label != do-not-merge
- author = dosubot[bot]
merge_conditions:
- check-success = quality
# Dependabot: full CI required
- name: dependabot
merge_method: squash
queue_conditions:
- base = main
- label != do-not-merge
- author = dependabot[bot]
merge_conditions:
- check-success = quality
- check-success = test
- check-success = test-cross-platform (ubuntu-latest, Linux)
- check-success = test-cross-platform (ubuntu-22.04, Linux)
- check-success = test-cross-platform (macos-latest, macOS)
- check-success = test-cross-platform (windows-latest, Windows)
- check-success = coverage
# Release-plz: DCO only (exempt from full CI -- code already tested on main)
- name: release-plz
merge_method: squash
queue_conditions:
- base = main
- label != do-not-merge
- author = release-plz[bot]
- head ~= ^release-plz-
merge_conditions:
- check-success = DCO
# Human PRs: merged ONLY on an explicit `@mergifyio queue` command. Repo
# permissions restrict who can send it.
#
# How that is enforced -- and what NOT to change:
#
# The `queue` command does NOT bypass `queue_conditions`. Per Mergify docs:
# "To enter a queue, a pull request must match the queue_conditions of the
# targeted queue." So the conditions below must stay SATISFIABLE by an
# ordinary human PR. Do not add an always-false condition (or a gating label
# like `ready-to-merge`) here to try to block auto-queueing: that would also
# reject the command and make human PRs unmergeable via Mergify.
#
# What actually prevents a human PR from auto-MERGING is
# `auto_merge_conditions` in `merge_protections_settings` below, which allows
# only the three bot patterns. That block is load-bearing -- if you edit it,
# re-verify that human PRs still require an explicit command.
#
# `label != do-not-merge` is a kill switch that applies even to a
# command-queued PR.
- name: default
merge_method: squash
queue_conditions:
- base = main
- label != do-not-merge
merge_conditions:
- check-success = quality
- check-success = test
- check-success = test-cross-platform (ubuntu-latest, Linux)
- check-success = test-cross-platform (ubuntu-22.04, Linux)
- check-success = test-cross-platform (macos-latest, macOS)
- check-success = test-cross-platform (windows-latest, Windows)
- check-success = coverage
pull_request_rules:
- name: Auto-approve dosubot PRs
conditions:
- base = main
- author = dosubot[bot]
actions:
review:
type: APPROVE
message: Automatically approved by Mergify
- name: Auto-approve dependabot PRs
conditions:
- base = main
- author = dependabot[bot]
actions:
review:
type: APPROVE
message: Automatically approved by Mergify
- name: Keep PRs up to date with main
conditions:
- base = main
- -conflict
- -draft
actions:
update: {}
merge_protections:
- name: Enforce conventional commit
description: >-
Require conventional commit format per https://www.conventionalcommits.org/en/v1.0.0/.
Skipped for bots.
if:
- base = main
- author != dependabot[bot]
- author != dosubot[bot]
- -head ~= ^release-plz-
success_conditions:
- "title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\\))?!?:"
- name: Full CI must pass
description: >-
All CI checks must pass. Release-plz PRs are exempt because they only
bump versions and changelogs (code was already tested on main), and
GITHUB_TOKEN-triggered force-pushes suppress CI.
if:
- base = main
- -head ~= ^release-plz-
success_conditions:
- check-success = quality
- check-success = test
- check-success = test-cross-platform (ubuntu-latest, Linux)
- check-success = test-cross-platform (ubuntu-22.04, Linux)
- check-success = test-cross-platform (macos-latest, macOS)
- check-success = test-cross-platform (windows-latest, Windows)
- check-success = coverage
- name: Do not merge outdated PRs
description: Make sure PRs are within 10 commits of the base branch before merging
if:
- base = main
success_conditions:
- "#commits-behind <= 10"
merge_protections_settings:
reporting_method: check-runs
# Second of two layers restricting auto-merge to bots. The first layer is the
# explicit `queue_conditions` on the `default` queue (a human PR is not
# enqueued without the `ready-to-merge` label or an `@mergifyio queue`
# command). This block is the backstop: even if a PR reaches a queue, only
# the three bot patterns below may auto-merge. Keep both -- neither is
# redundant.
auto_merge_conditions:
- or:
- and:
- base = main
- label != do-not-merge
- author = dosubot[bot]
- and:
- base = main
- label != do-not-merge
- author = dependabot[bot]
- and:
- base = main
- label != do-not-merge
- author = release-plz[bot]
- head ~= ^release-plz-