-
Notifications
You must be signed in to change notification settings - Fork 30
/
reviewpad.yml
118 lines (104 loc) · 4.63 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
extends:
- https://github.com/reviewpad/.github/blob/main/reviewpad-models/common.yml
labels:
external-contribution:
description: External contribution
color: "#8a2151"
plugins:
description: Modifications to the plugins directory
color: "#294b72"
critical:
description: Modifications to critical changes
color: "#294b75"
groups:
- name: owners
description: Group of owners
kind: developers
spec: '["ferreiratiago", "marcelosousa"]'
- name: maintainers
description: Official maintainers
spec: '["marcelosousa", "ferreiratiago", "shay2025", "zolamk"]'
rules:
# This rule is used to block pull request from being merged.
# It is used on extended reviewpad common.yml configuration.
- name: should block pull request
description: The pull request should be blocked
spec: $isElementOf("do-not-merge", $labels()) || !$isElementOf($author(), $group("maintainers")) || $hasFileName("LICENSE")
- name: touches plugin functions
description: Modifies the plugin functions
spec: $hasFilePattern("plugins/aladino/functions/**")
- name: touches plugin actions
description: Modifies the plugin actions
spec: $hasFilePattern("plugins/aladino/actions/**")
- name: touches plugin functions and actions
description: Modifies both plugin actions and functions
spec: $rule("touches plugin actions") && $rule("touches plugin functions")
- name: touches plugin functions or actions and not builtins
description: Modifies plugins but not built-ins
spec: ($rule("touches plugin actions") || $rule("touches plugin functions")) && !$hasFileName("plugins/aladino/builtins.go")
workflows:
- name: external contribution
run:
- if: '!$isElementOf($author(), $group("maintainers"))'
then:
- $addLabel("external-contribution")
- if: $author() != "renovate"
then: $info($sprintf("@%s thanks for your contribution!", [$author()]))
- name: link to GitHub project
run:
- if: $rule("is ready") && !$hasLinkedIssues() && !$isLinkedToProject("Reviewpad")
then: $addToProject("Reviewpad", "In Review")
- name: changes to critical code
run:
- if: $rule("is ready")
then:
- if: $hasAnnotation("critical") || $hasFileName("runner.go")
then: $addLabel("critical")
- name: awareness
description: Create awareness when some parts of the code are being modified.
run:
- if: $rule("is ready")
then:
- if: $rule("touches plugin functions") || $rule("touches plugin actions")
then:
- $addLabel("plugins")
- $info("If you are adding or updating a built-in, please do not forget to update the [docs](https://github.com/reviewpad/docs)")
- if: $rule("touches plugin functions and actions")
then: $warn("It looks like you modified both functions and actions. Is that intentional?")
- if: $rule("touches plugin functions or actions and not builtins")
then: $info("If you have added a new function or action do not forget to include it in the built-in list!")
pipelines:
- name: license
description: Pull request that touches the LICENSE file
trigger: $hasFileName("LICENSE")
stages:
- actions:
- $error("Sorry, you are not authorized to make these changes")
- $close()
until: $isElementOf($author(), $group("owners"))
- actions:
- $error("You are changing more than the LICENSE file. Pull request that change the LICENSE file should only modify the LICENSE file.")
- $close()
until: $fileCount() == 1
- actions:
- $addLabel("modifies-license")
- $assignReviewer($group("owners"), 1)
- name: renovate-bot
description: Pull request from renovate bot
trigger: $author() == "renovate"
stages:
- actions:
- $comment("Pull request is not up to date with the base branch. Reviewpad will rebase it for you. Please wait for the rebase to complete.")
- $rebase()
until: $isUpdatedWithBaseBranch() && $hasLinearHistory()
- actions:
- $commentOnce("Some checks are still running. Closing the pull request.")
- $close()
until: '!$hasAnyCheckRunCompleted([], ["failure"])'
- actions:
- $info("Reviewpad is waiting for all checks to complete with success.")
until: $haveAllChecksRunCompleted(["reviewpad"], "success")
- actions:
- $assignAssignees($group("owners"), 1)
- $approve("Pull request is ready to be merged. Reviewpad will merge it for you. Please wait for the merge to complete.")
- $merge("squash")