From c8f518f81393a6d810049b45370dd84417d59aaf Mon Sep 17 00:00:00 2001 From: Jaied Al Sabid <87969327+jaieds@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:38:26 +0600 Subject: [PATCH 1/2] Created workflow for code review --- .github/workflows/code-reviewer.yml | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/code-reviewer.yml diff --git a/.github/workflows/code-reviewer.yml b/.github/workflows/code-reviewer.yml new file mode 100644 index 00000000..5e1a19da --- /dev/null +++ b/.github/workflows/code-reviewer.yml @@ -0,0 +1,43 @@ +name: BSF Code Reviewer + +on: + pull_request: + types: [opened, synchronize, edited] + +permissions: write-all + +jobs: + CHECK_SHORTCODE: + if: contains(github.event.pull_request.body, '[BSF-PR-SUMMARY]') + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: WRITE PR SUMMARY + uses: brainstormforce/pull-request-reviewer@master + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + ACTION_CONTEXT: 'CHECK_SHORTCODE' + EXCLUDE_EXTENSIONS: "md, yml, lock" + INCLUDE_EXTENSIONS: "php, js, jsx, ts, tsx, css, scss, html, json" + EXCLUDE_PATHS: "node_modules/,vendor/" + + CODE_REVIEW: + needs: CHECK_SHORTCODE + if: always() + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: AI CODE REVIEW + uses: brainstormforce/pull-request-reviewer@master + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + ACTION_CONTEXT: "CODE_REVIEW" + EXCLUDE_EXTENSIONS: "md, yml, lock" + INCLUDE_EXTENSIONS: "php, js, jsx, ts, tsx, css, scss, html, json" + EXCLUDE_PATHS: "node_modules/,vendor/" \ No newline at end of file From ca8546af64f20cbfed13dfd6dd480f5dabfd1357 Mon Sep 17 00:00:00 2001 From: Jaied Al Sabid <87969327+jaieds@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:41:08 +0600 Subject: [PATCH 2/2] Update code-reviewer.yml --- .github/workflows/code-reviewer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-reviewer.yml b/.github/workflows/code-reviewer.yml index 5e1a19da..c1681125 100644 --- a/.github/workflows/code-reviewer.yml +++ b/.github/workflows/code-reviewer.yml @@ -22,7 +22,7 @@ jobs: ACTION_CONTEXT: 'CHECK_SHORTCODE' EXCLUDE_EXTENSIONS: "md, yml, lock" INCLUDE_EXTENSIONS: "php, js, jsx, ts, tsx, css, scss, html, json" - EXCLUDE_PATHS: "node_modules/,vendor/" + EXCLUDE_PATHS: "node_modules/" CODE_REVIEW: needs: CHECK_SHORTCODE @@ -40,4 +40,4 @@ jobs: ACTION_CONTEXT: "CODE_REVIEW" EXCLUDE_EXTENSIONS: "md, yml, lock" INCLUDE_EXTENSIONS: "php, js, jsx, ts, tsx, css, scss, html, json" - EXCLUDE_PATHS: "node_modules/,vendor/" \ No newline at end of file + EXCLUDE_PATHS: "node_modules/" \ No newline at end of file