diff --git a/.github/workflows/code_review.yml b/.github/workflows/code_review.yml new file mode 100644 index 00000000..a61555a5 --- /dev/null +++ b/.github/workflows/code_review.yml @@ -0,0 +1,24 @@ +# Create an automated AI code review that runs when a PR is labeled with 'code-review' +name: code-review + +on: + pull_request: + types: [ labeled ] + +jobs: + get-code-review: + runs-on: ubuntu-latest + if: contains(github.event.pull_request.labels.*.name, 'code-review') # || github.event_name == 'push' || github.event_name == 'workflow_dispatch' + permissions: + contents: read + pull-requests: write + steps: + - uses: MannLabs/alphashared/actions/code-review@v1 + continue-on-error: true + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + CODE_REVIEW_PROMPT: ${{ secrets.CODE_REVIEW_PROMPT }} + CODE_REVIEW_SYSTEM_MESSAGE: ${{ secrets.CODE_REVIEW_SYSTEM_MESSAGE }} + GITHUB_EVENT_NUMBER: ${{ github.event.number }} + EXCLUDED_EXTENSIONS: "ipynb;js"