/
mergify.yml
80 lines (72 loc) · 1.91 KB
/
mergify.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
# For condition grammar see: https://docs.mergify.com/conditions/#grammar
shared:
conditions:
- and: &pr_ready_checks
- "#approved-reviews-by>=1" # A '#' pulls the length of the underlying list
- "label=ready-to-merge"
- "check-success=tests"
- "-draft" # Don't include draft PRs
- "-merged"
- or: # Only handle branches that target main or develop branches
- "base=main"
- "base~=^develop"
queue_rules:
- name: default
conditions:
- and: *pr_ready_checks
merge_method: squash
pull_request_rules:
# Merge Queue PR Rules
- name: Regular PRs - Add to merge queue on approval (squash)
conditions:
- and: *pr_ready_checks
- "-head~=^develop" # Don't include PRs from develop branches
actions:
queue:
method: squash
# Automatic PR Updates
- name: Automatic PR branch updates
conditions:
- "queue-position=-1" # Not queued
- "-draft" # Don't include draft PRs
- "-merged"
actions:
update:
# Automatic Labeling
- name: Clean up after merge
conditions:
- merged
actions:
delete_head_branch:
label:
remove:
- "merge-conflicts"
- "ready-to-merge"
- "tests-failing"
- name: Toggle label on merge conflicts
conditions:
- "-merged"
- conflict
actions:
label:
toggle:
- "merge-conflicts"
# Don't use a toggle for this, as the label constantly gets applied and removed when tests are rerun.
- name: Add label on test failures
conditions:
- "-merged"
- or:
- check-failure=tests
- check-skipped=tests
actions:
label:
add:
- "tests-failing"
- name: Remove label on test success
conditions:
- "-merged"
- check-success=tests
actions:
label:
remove:
- "tests-failing"