-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathreviewpad.yml
88 lines (81 loc) · 3.06 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
# Define the list of labels to be used by Reviewpad.
# For more details see https://docs.reviewpad.com/guides/syntax#label.
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"
rules:
- name: is-release-branch
spec: $base() == "beta" || $base() == "alpha" || $base() == "release"
- name: is-main-branch
spec: $base() == "main"
# Define the list of workflows to be run by Reviewpad.
# A workflow is a list of actions that will be executed based on the defined rules.
# For more details see https://docs.reviewpad.com/guides/syntax#workflow.
workflows:
# This workflow praises contributors on their pull request contributions.
# This helps contributors feel appreciated.
- name: praise-contributors-on-milestones
description: Praise contributors based on their contributions
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()]))
# This workflow validates that pull requests follow the conventional commits specification.
# This helps developers automatically generate changelogs.
# For more details, see https://www.conventionalcommits.org/en/v1.0.0/.
- 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()
- name: check-conventional-commits-title
description: Pull request titles to follow conventional commits when squashing and merging
always-run: true
run:
if:
- rule: $isDraft() == false && $rule("is-main-branch")
then:
- $titleLint()
- name: size-labeling
description: Label pull request based on the number of lines changed
always-run: true
if:
- rule: $size() < 100
extra-actions:
- $removeLabels(["medium", "large"])
- $addLabel("small")
- rule: $size() >= 100 && $size() < 300
extra-actions:
- $removeLabels(["small", "large"])
- $addLabel("medium")
- rule: $size() >= 300
extra-actions:
- $removeLabels(["small", "medium"])
- $addLabel("large")
- name: license-validation
description: Validate that licenses are not modified
always-run: true
if:
# Fail Reviewpad check on pull requests that modify any LICENSE;
- rule: $hasFilePattern("**/LICENSE*")
extra-actions:
- $fail("License files cannot be modified")
- name: auto-merge-release-pr
description: Automatically merge with a merge commit on release branch
run:
if:
- rule: $rule("is-release-branch") && $approvalsCount() >= 1 && $haveAllChecksRunCompleted([], "success")
then:
- $merge("merge")