From c8b57f14041cdde3f027c6cd99694627e66050a9 Mon Sep 17 00:00:00 2001 From: Zakary Timson Date: Wed, 14 Jan 2026 12:09:58 -0500 Subject: [PATCH] Add .github/workflows/code-review.yaml --- .github/workflows/code-review.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/code-review.yaml diff --git a/.github/workflows/code-review.yaml b/.github/workflows/code-review.yaml new file mode 100644 index 0000000..5e17c20 --- /dev/null +++ b/.github/workflows/code-review.yaml @@ -0,0 +1,29 @@ +name: Code review + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + review: + runs-on: ubuntu-latest + container: node:22 + steps: + - name: Fetch code + run: | + git clone "$(echo ${{github.server_url}}/${{github.repository}}.git | sed s%://%://${{github.token}}@% )" . + git checkout ${{ github.event.pull_request.head.sha }} + git fetch origin ${{ github.event.pull_request.base.ref }} + + - name: Run AI Review + run: npx -y @ztimson/ai-agents@latest review + env: + AI_HOST: anthropic + AI_MODEL: claude-sonnet-4-5 + AI_TOKEN: ${{ secrets.ANTHROPIC_TOKEN }} + GIT_HOST: ${{ github.server_url }} + GIT_OWNER: ${{ github.repository_owner }} + GIT_REPO: ${{ github.event.repository.name }} + GIT_TOKEN: ${{ secrets.ASSISTANT_TOKEN }} + GIT_BRANCH: origin/${{ github.event.pull_request.base.ref }} + PULL_REQUEST: ${{ github.event.pull_request.number }}