Skip to content

Commit bcdda38

Browse files
Create best_practices.cm
1 parent 7c5b33d commit bcdda38

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.cm/best_practices.cm

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# -*- mode: yaml -*-
2+
3+
manifest:
4+
version: 1.0
5+
6+
automations:
7+
best_practices:
8+
if:
9+
- {{ branch.diff.size < 150 }}
10+
- {{ (has.jira_ticket_in_title or has.jira_ticket_in_desc) }}
11+
- {{ branch | estimatedReviewTime < 10 }}
12+
- {{ files | match(regex=r/Standard\/best-practices\//) | every }}
13+
run:
14+
- action: add-label@v1
15+
args:
16+
label: "🌟 Best Practices 🌟"
17+
color: {{ colors.green }}
18+
- action: add-comment@v1
19+
args:
20+
comment: "Thank you for following the team's recommended development practices!"
21+
estimated_time_to_review:
22+
if:
23+
- true
24+
run:
25+
- action: add-label@v1
26+
args:
27+
label: "{{ calc.etr }} min review"
28+
color: {{ colors.red if (calc.etr >= 20) else ( colors.yellow if (calc.etr >= 5) else colors.green ) }}
29+
30+
calc:
31+
etr: {{ branch | estimatedReviewTime }}
32+
33+
34+
colors:
35+
red: 'b60205'
36+
yellow: 'fbca04'
37+
green: '0e8a16'
38+
39+
has:
40+
jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
41+
jira_ticket_in_desc: {{ pr.description | includes(regex=r/atlassian.net/) }}

0 commit comments

Comments
 (0)