Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add reviewpad configuration #191

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions reviewpad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
dictionaries:
- name: Label per file path
description: Labels to apply based on the path of the touched files
spec:
'**/app/**': '"app"'
'**/web/**': '"web"'
'**/blog/**': '"blog"'

rules:
- name: Open PR state
spec: '!$isDraft() && $getState() == "open"'

- name: First run state
spec: $getEventType() == "opened" && $rule("Open PR state")

workflows:
- name: Assign author
run:
- if: $rule("First run state")
then: $addAssignees([$getAuthor()])

- name: Add labels to PR
run:
- if: $rule("Open PR state")
then:
- forEach:
key: $filePattern
value: $label
in: $dictionary("Label per file path")
do:
- if: $containsFilePattern($filePattern)
then:
- $addLabel($label)

- name: Request review from maintainers
run:
- if: $rule("First run state")
then: $addReviewers($getTeamMembers("shuriken"))

- name: Base message and summary
run:
- if: $rule("First run state")
then:
- if: $countUserPullRequests($getAuthor()) == 1
then: $info("Thanks for your first contribution!")
else: $info("Thanks for your contribution!")
- $warn("Please make sure the CI is green before merging.")
- $summarize()

- name: Enforce conventional commits
run:
- if: $rule("Open PR state")
then: $titleLint()

- name: Enforce head branch deletion
always-run: true
run: $deleteHeadBranch()