-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
reviewpad.yml
144 lines (135 loc) · 5.02 KB
/
reviewpad.yml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
api-version: reviewpad.com/v3.x
labels:
small:
description: Pull request is small
color: "#76dbbe"
medium:
description: Pull request is medium
color: "#2986cc"
large:
description: Pull request is large
color: "#c90076"
dependencies:
description: Something about our dependencies
color: "#ff8722"
build:
description: Marks issues or pull requests regarding changes to the build tool
color: "#FCEA0F"
breaking-change:
description: Marks a pull request as introducing breaking changes
color: "#b3c9c9"
no-releasenotes:
description: To not include a pull request in the changelog
color: "#333635"
needs-review:
description: Marks a pull request as waiting for review
color: "#aa2297"
rules:
- name: docs-changes
spec: $hasFileExtensions([".md", ".txt"]) || $matchString("^docs(\([A-Za-z0-9_\/]+\))??:.+$", $title())
- name: ci-changes
spec: $hasFilePattern(".github/**") || $hasFilePattern(".circleci/**") || $hasFileName(".golangci.yml") || $hasFileName("reviewpad.yml") || $hasFileName(".goreleaser.yml") || $matchString("^ci(\([A-Za-z0-9_\/]+\))??:.+$", $title())
- name: deps-changes
spec: $hasFileName("go.mod") || $hasFileName("go.sum") || $matchString("^build\(deps\)\/.+", $title())
- name: feat-changes
spec: $matchString("^feat(\([A-Za-z0-9_\/]+\))??:.+$", $title())
- name: fix-changes
spec: $matchString("^fix(\([A-Za-z0-9_\/]+\))??:.+$", $title())
- name: breaking-changes
spec: $matchString("^([A-Za-z0-9_]+)??(\([A-Za-z0-9_\/]+\))??!:.+$", $title())
- name: exclude-changes
spec: $matchString("^(chore|refactor|revert|perf|test)(\([A-Za-z0-9_\/]+\))??:.+$", $title())
- name: build-changes
spec: $hasFileName("makefile") || $matchString("^build(\([A-Za-z0-9_\/]+\))??:.+$", $title())
groups:
- name: ignore-patterns
spec: '["go.sum"]'
workflows:
- name: praise-contributors
description: Praise contributors
always-run: true
if:
# Praise contributors on their first pull request.
- rule: $pullRequestCountBy($author()) == 1
extra-actions:
- $commentOnce($sprintf("Thank you @%s for this first contribution!", [$author()]))
# Praise contributors on their 10th pull request.
- rule: $pullRequestCountBy($author()) == 10
extra-actions:
- $commentOnce($sprintf("Way to go %s 🎉 ... This is your 10th pull request!", [$author()]))
- name: check-conventional-commits
description: Validate that pull requests follow the conventional commits
always-run: true
if:
- rule: $isDraft() == false
then:
# Check commits messages against the conventional commits specification
- $commitLint()
# Check pull request title against the conventional commits specification.
- $titleLint()
- name: best-practices
description: Validate best practices for pull request management
always-run: true
if:
# Warn pull requests that do not have an associated GitHub issue.
- rule: $hasLinkedIssues() == false
extra-actions:
- $warn("Please link an issue to the pull request")
# Warn pull requests if their description is empty.
- rule: $description() == ""
extra-actions:
- $warn("Please provide a description for the pull request")
# Warn pull request do not have a clean linear history.
- rule: $hasLinearHistory() == false
extra-actions:
- $warn("Please rebase your pull request on the latest changes")
- name: size-labeling
description: Label pull request based on the number of lines changed
always-run: true
if:
- rule: $size($group("ignore-patterns")) < 100
extra-actions:
- $removeLabels(["medium", "large"])
- $addLabel("small")
- rule: $size($group("ignore-patterns")) >= 100 && $size() < 300
extra-actions:
- $removeLabels(["small", "large"])
- $addLabel("medium")
- rule: $size($group("ignore-patterns")) >= 300
extra-actions:
- $removeLabels(["small", "medium"])
- $addLabel("large")
- name: pulls-labelling
description: Label pull requests
always-run: true
if:
- rule: docs-changes
extra-actions:
- $addLabel("docs")
- rule: ci-changes
extra-actions:
- $addLabel("ci")
- rule: deps-changes
extra-actions:
- $addLabel("dependencies")
- rule: build-changes
extra-actions:
- $addLabel("build")
- rule: feat-changes
extra-actions:
- $addLabel("enhancement")
- rule: fix-changes
extra-actions:
- $addLabel("bug")
- rule: breaking-changes
extra-actions:
- $addLabel("breaking-change")
- rule: exclude-changes
extra-actions:
- $addLabel("no-releasenotes")
- rule: $isWaitingForReview()
extra-actions:
- $addLabel("needs-review")
- rule: $isWaitingForReview() == false
extra-actions:
- $removeLabel("needs-review")