forked from openai/swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitstream.cm
85 lines (74 loc) · 2 KB
/
gitstream.cm
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
81
82
83
84
85
manifest:
version: 1.0
automations:
estimated_time_to_review:
if:
- true
run:
- action: add-label@v1
args:
label: "{{ calc.etr }} min review"
color: "{{ colors.red if (calc.etr >= 20) else (colors.yellow if (calc.etr >= 5) else colors.green) }}"
safe_changes:
if:
- "{{ is.formatting or is.docs or is.tests or is.image }}"
run:
- action: add-label@v1
args:
label: "safe-change"
- action: approve@v1
- action: add-comment@v1
args:
comment: "This PR is considered a safe change and has been automatically approved."
label_unresolved_threads:
if:
- "{{ pr.status == 'open' }}"
- "{{ pr.unresolved_threads }}"
run:
- action: add-label@v1
args:
label: "🚨 {{ pr.unresolved_threads }} Unresolved Thread(s)"
color: "{{ colors.yellow }}"
flag_deleted_files:
if:
- "{{ has.deleted_files }}"
run:
- action: add-label@v1
args:
label: "🗑️ Deleted files"
color: "{{ colors.orange }}"
label_from_branch:
if:
- true
run:
- action: add-label@v1
args:
label: "branch-{{ branch_prefix }}"
- action: add-label@v1
args:
label: "{{ 'urgent' if is_hotfix else '' }}"
calc:
etr: "{{ branch | estimatedReviewTime }}"
is:
formatting: "{{ source.diff.files | isFormattingChange }}"
docs: "{{ files | allDocs }}"
tests: "{{ files | allTests }}"
image: "{{ files | allImages }}"
has:
deleted_files: "{{ source.diff.files | map(attr='new_file') | match(term='/dev/null') | some }}"
colors:
red: "b60205"
orange: "d93f0b"
yellow: "fbca04"
green: "0e8a16"
blue: "1d76db"
purple: "5319e7"
branch_prefix: >
{{ branch.split('/')[0] if '/' in branch else branch }}
is_hotfix: >
{{ branch.startswith('hotfix/') }}
# Debug output
debug_output:
branch_name: "{{ branch }}"
branch_prefix: "{{ branch_prefix }}"
is_hotfix: "{{ is_hotfix }}"