From e07d0e639ad670803d058781bb209c70f9e3365a Mon Sep 17 00:00:00 2001 From: Rui Lopes <76881129+RuiL1904@users.noreply.github.com> Date: Sun, 20 Aug 2023 13:49:49 +0100 Subject: [PATCH 1/2] chore: add reviewpad configuration --- reviewpad.yml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 reviewpad.yml diff --git a/reviewpad.yml b/reviewpad.yml new file mode 100644 index 00000000..08606efe --- /dev/null +++ b/reviewpad.yml @@ -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() From 0c2bb6fd32b182716e2527b6968cbed798e9b6ea Mon Sep 17 00:00:00 2001 From: Rui Lopes <76881129+RuiL1904@users.noreply.github.com> Date: Sun, 20 Aug 2023 13:51:54 +0100 Subject: [PATCH 2/2] fix: tabulation --- reviewpad.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reviewpad.yml b/reviewpad.yml index 08606efe..e4ed6354 100644 --- a/reviewpad.yml +++ b/reviewpad.yml @@ -24,13 +24,13 @@ workflows: - if: $rule("Open PR state") then: - forEach: - key: $filePattern - value: $label - in: $dictionary("Label per file path") - do: - - if: $containsFilePattern($filePattern) - then: - - $addLabel($label) + key: $filePattern + value: $label + in: $dictionary("Label per file path") + do: + - if: $containsFilePattern($filePattern) + then: + - $addLabel($label) - name: Request review from maintainers run: