Skip to content

Commit 3d2f57f

Browse files
committed
mergify: simplify the script
Already assumed labels should not be checked again, lets keep it simple.
1 parent 8e0b8ba commit 3d2f57f

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

.mergify.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@
1515
# limitations under the License.
1616

1717
# Mergify follow our workflow: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html
18+
# Inital state is done by internal reviewer bot
19+
20+
# Notes: conditions do not check if label is already there if we add or remote, this is to limit Github API access to
21+
# minimum. If a label is already there and we add it again, nothing bad happens (we gain 1 less access).
22+
# For instance for needs: work if CI failed, we just add a label as action.
1823

1924
pull_request_rules:
25+
# From review to needs: work - reviewers request
2026
- name: "label needs: work when changes were requested"
2127
conditions:
22-
# Labels
23-
- "label!=needs: work"
24-
- "label!=needs: preceding PR"
25-
2628
# Reviewers
2729
- "#changes-requested-reviews-by>0"
2830
actions:
@@ -32,12 +34,9 @@ pull_request_rules:
3234
remove:
3335
- "needs: review"
3436

37+
# From review to needs: work - CI failure
3538
- name: "label needs: work when travis-ci failed"
3639
conditions:
37-
# Labels
38-
- "label!=needs: work"
39-
- "label!=needs: preceding PR"
40-
4140
# Travis failing
4241
- status-failure~=continuous-integration/travis-ci/pr
4342
actions:
@@ -47,6 +46,7 @@ pull_request_rules:
4746
remove:
4847
- "needs: review"
4948

49+
# From review to needs: work - CI failure
5050
- name: "label needs: work when Jenkins CI failed - pr head"
5151
conditions:
5252
# Jenkins CI failing
@@ -55,7 +55,10 @@ pull_request_rules:
5555
label:
5656
add:
5757
- "needs: work"
58+
remove:
59+
- "needs: review"
5860

61+
# From review to needs: work - CI failure
5962
- name: "label needs: work when Jenkins CI failed - any of the pipeline"
6063
conditions:
6164
# Jenkins CI failing - any of the pipeline
@@ -64,6 +67,8 @@ pull_request_rules:
6467
label:
6568
add:
6669
- "needs: work"
70+
remove:
71+
- "needs: review"
6772

6873
- name: "label needs: CI when at least one reviewers approval"
6974
conditions:
@@ -127,9 +132,6 @@ pull_request_rules:
127132
conditions:
128133
# Labels
129134
- label!=do not merge
130-
- "label!=needs: work"
131-
- "label!=needs: preceding PR"
132-
- "label!=needs: review"
133135
- "label=needs: CI"
134136

135137
# Reviewers

0 commit comments

Comments
 (0)