From 815970333a5d9b7be12005e6b4dc913f2ccc0b98 Mon Sep 17 00:00:00 2001 From: marcelosousa <601882+marcelosousa@users.noreply.github.com> Date: Wed, 31 Aug 2022 00:16:14 +0100 Subject: [PATCH 1/4] ci: replace labeler with reviewpad action --- .github/labeler.yml | 3 --- .github/reviewpad.yml | 26 ++++++++++++++++++++++++++ .github/workflows/label.yml | 19 ------------------- .github/workflows/reviewpad.yml | 20 ++++++++++++++++++++ 4 files changed, 46 insertions(+), 22 deletions(-) delete mode 100644 .github/labeler.yml create mode 100644 .github/reviewpad.yml delete mode 100644 .github/workflows/label.yml create mode 100644 .github/workflows/reviewpad.yml diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 7d38c713..00000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,3 +0,0 @@ -jira-onpremise: onpremise/**/* -jira-cloud: cloud/**/* -documentation: docs/**/* \ No newline at end of file diff --git a/.github/reviewpad.yml b/.github/reviewpad.yml new file mode 100644 index 00000000..d85b3dd2 --- /dev/null +++ b/.github/reviewpad.yml @@ -0,0 +1,26 @@ +api-version: reviewpad.com/v3.x + +workflows: + - name: label-pull-request-with-size + if: + - rule: $size() <= 25 + extra-actions: + - $addLabel("small") + - rule: $size() > 25 && $size() <= 100 + extra-actions: + - $addLabel("medium") + - rule: $size() > 100 + extra-actions: + - $addLabel("large") + + - name: label-pull-requests-based-on-path + if: + - rule: $hasFilePattern("onpremise/**") + extra-actions: + - $addLabel("jira-onpremise") + - rule: $hasFilePattern("cloud/**") + extra-actions: + - $addLabel("jira-cloud") + - rule: $hasFilePattern("docs/**") + extra-actions: + - $addLabel("documentation") diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml deleted file mode 100644 index b37fcb9d..00000000 --- a/.github/workflows/label.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Label pull requests - -on: - pull_request: - workflow_dispatch: - -# limit permissions -permissions: - contents: read - pull-requests: write - -jobs: - build: - runs-on: ubuntu-latest - if: (github.actor != 'dependabot[bot]') - steps: - - uses: actions/labeler@v4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/reviewpad.yml b/.github/workflows/reviewpad.yml new file mode 100644 index 00000000..af7d867c --- /dev/null +++ b/.github/workflows/reviewpad.yml @@ -0,0 +1,20 @@ +name: Reviewpad + +on: + pull_request_target: + +permissions: + pull-requests: write + +jobs: + reviewpad_job: + runs-on: ubuntu-latest + name: Reviewpad + steps: + # Run Reviewpad on all new Pull Requests! 🦄 + - name: Reviewpad + uses: reviewpad/action@v3.x + with: + # Uses a default Reviewpad configuration file to get your started. + # For customization and documentation, see https://github.com/reviewpad/action + file: .github/reviewpad.yml \ No newline at end of file From 836a8e68d668099ecd8980df6bee1fe13362b6ec Mon Sep 17 00:00:00 2001 From: marcelosousa <601882+marcelosousa@users.noreply.github.com> Date: Wed, 31 Aug 2022 00:17:49 +0100 Subject: [PATCH 2/4] chore: add new line --- .github/workflows/reviewpad.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reviewpad.yml b/.github/workflows/reviewpad.yml index af7d867c..364abb34 100644 --- a/.github/workflows/reviewpad.yml +++ b/.github/workflows/reviewpad.yml @@ -17,4 +17,4 @@ jobs: with: # Uses a default Reviewpad configuration file to get your started. # For customization and documentation, see https://github.com/reviewpad/action - file: .github/reviewpad.yml \ No newline at end of file + file: .github/reviewpad.yml From 1773e477e98180756d1ae9958435c5901890f420 Mon Sep 17 00:00:00 2001 From: marcelosousa <601882+marcelosousa@users.noreply.github.com> Date: Wed, 31 Aug 2022 00:20:01 +0100 Subject: [PATCH 3/4] feat: add welcome message to first contributors --- .github/reviewpad.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/reviewpad.yml b/.github/reviewpad.yml index d85b3dd2..06942b62 100644 --- a/.github/reviewpad.yml +++ b/.github/reviewpad.yml @@ -2,6 +2,7 @@ api-version: reviewpad.com/v3.x workflows: - name: label-pull-request-with-size + always-run: true if: - rule: $size() <= 25 extra-actions: @@ -14,6 +15,7 @@ workflows: - $addLabel("large") - name: label-pull-requests-based-on-path + always-run: true if: - rule: $hasFilePattern("onpremise/**") extra-actions: @@ -24,3 +26,10 @@ workflows: - rule: $hasFilePattern("docs/**") extra-actions: - $addLabel("documentation") + + - name: welcome-first-contributors + always-run: true + if: + - rule: $totalCreatedPullRequests($author()) == 1 + extra-actions: + - '$commentOnce("Thank you so much for your first contribution!")' From 3ae7b5aa374ce2662f708c3483b6b9d5febdf04a Mon Sep 17 00:00:00 2001 From: marcelosousa <601882+marcelosousa@users.noreply.github.com> Date: Wed, 31 Aug 2022 00:23:01 +0100 Subject: [PATCH 4/4] feat: add more workflows --- .github/reviewpad.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/reviewpad.yml b/.github/reviewpad.yml index 06942b62..597c83ee 100644 --- a/.github/reviewpad.yml +++ b/.github/reviewpad.yml @@ -33,3 +33,10 @@ workflows: - rule: $totalCreatedPullRequests($author()) == 1 extra-actions: - '$commentOnce("Thank you so much for your first contribution!")' + + - name: lint-commits + always-run: true + if: + - rule: '!$hasLinearHistory()' + extra-actions: + - '$warn("This pull request does not have linear history - please fix it!")'