From cbb8c0d7b154c5e3ec24492b10c24f84388e85c5 Mon Sep 17 00:00:00 2001 From: Vijeta Raikar <110518282+vijetaR@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:30:03 +0530 Subject: [PATCH] AI code reviwer --- .github/PULL_REQUEST_TEMPLATE.md | 22 +++++++++++++ .github/workflows/ai-code-reviewer.yml | 45 ++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/ai-code-reviewer.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..bf53269 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,22 @@ +### Description +[BSF-PR-SUMMARY] + +### Screenshots + + +### Types of changes + + + + + +### How has this been tested? + + +### Checklist: +- [ ] My code is tested +- [ ] My code follows accessibility standards +- [ ] My code has proper inline documentation +- [ ] I've included any necessary tests +- [ ] I've included developer documentation +- [ ] I've added proper labels to this pull request diff --git a/.github/workflows/ai-code-reviewer.yml b/.github/workflows/ai-code-reviewer.yml new file mode 100644 index 0000000..8708e0b --- /dev/null +++ b/.github/workflows/ai-code-reviewer.yml @@ -0,0 +1,45 @@ +name: BSF Code Reviewer + +on: + pull_request: + types: [opened, synchronize, edited] + +permissions: write-all + +jobs: + CHECK_SHORTCODE: + if: ${{ github.event.action == 'edited' || 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 + 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" + JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} + JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }} + JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }} + 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