From 5c7de756611e3692d364f166e42ab5490cd65362 Mon Sep 17 00:00:00 2001 From: adbridge Date: Mon, 23 Mar 2020 13:51:19 +0000 Subject: [PATCH] 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 --- .mergify.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.mergify.yml b/.mergify.yml index f823b02c78..84bacd1668 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -102,6 +102,7 @@ pull_request_rules: # Conflict in the PR - needs: work and a comment to notify a user - name: "label needs: work when there is a conflict" conditions: + - open - conflict actions: label: @@ -158,7 +159,7 @@ pull_request_rules: add: ['do not merge'] # Check if version label is applied - - name: release version is a must for merged PRs + - name: release version is a must for merged PRs part 1 conditions: - merged - -label~=^(release-version) @@ -169,4 +170,22 @@ pull_request_rules: comment: message: This PR does not contain release version label after merging. + # If there is a release version remove 'release version missing' and / or + # release review required + - name: release version is a must for merged PRs part 2 + conditions: + - merged + - -label=^(release-version) + actions: + label: + remove: ['release version missing', 'Release review required'] + + # Clean-up if closed but not merged + - name: remove release version and needs labels + conditions: + - closed + - -merged + actions: + label: + remove_all=True