Skip to content

Commit 5c7de75

Browse files
committed
Fix incomplete mergify rules
1. If a PR is closed but not merged then remove all labels 2. If a release version is added and there are release version missing or Release review required, then remove those labels 3. In the check for conflicts rule, add the condition 'open' so that it isn't applied to closed or merged PRs
1 parent 6964679 commit 5c7de75

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.mergify.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ pull_request_rules:
102102
# Conflict in the PR - needs: work and a comment to notify a user
103103
- name: "label needs: work when there is a conflict"
104104
conditions:
105+
- open
105106
- conflict
106107
actions:
107108
label:
@@ -158,7 +159,7 @@ pull_request_rules:
158159
add: ['do not merge']
159160

160161
# Check if version label is applied
161-
- name: release version is a must for merged PRs
162+
- name: release version is a must for merged PRs part 1
162163
conditions:
163164
- merged
164165
- -label~=^(release-version)
@@ -169,4 +170,22 @@ pull_request_rules:
169170
comment:
170171
message: This PR does not contain release version label after merging.
171172

173+
# If there is a release version remove 'release version missing' and / or
174+
# release review required
175+
- name: release version is a must for merged PRs part 2
176+
conditions:
177+
- merged
178+
- -label=^(release-version)
179+
actions:
180+
label:
181+
remove: ['release version missing', 'Release review required']
182+
183+
# Clean-up if closed but not merged
184+
- name: remove release version and needs labels
185+
conditions:
186+
- closed
187+
- -merged
188+
actions:
189+
label:
190+
remove_all=True
172191

0 commit comments

Comments
 (0)