From 116a056455e65ba3c66b4a35aa931a594b832e07 Mon Sep 17 00:00:00 2001 From: EmersonBraun Date: Thu, 18 Jun 2026 15:01:58 -0300 Subject: [PATCH] ci: AI code review on PRs (self-hosted, claude -p, advisory) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Runs the AgentsKit code-review agent locally on a self-hosted runner via claude -p (subscription, no per-call API cost). Advisory — posts a review, never blocks. Guarded to non-fork PRs only (head.repo == repo) so untrusted fork code never runs on the self-hosted runner. --- .github/workflows/code-review.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/code-review.yml diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml new file mode 100644 index 000000000..6c69b7043 --- /dev/null +++ b/.github/workflows/code-review.yml @@ -0,0 +1,29 @@ +# AI code review on every PR — runs LOCALLY on a self-hosted runner via `claude -p` +# (subscription, no per-call API cost). Advisory: posts a review, never blocks. +name: Code Review + +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: write + +jobs: + review: + # SECURITY: only PRs from branches in this repo (maintainers). Fork PRs are + # skipped — never run untrusted fork code on the self-hosted runner. + if: github.event.pull_request.head.repo.full_name == github.repository + runs-on: self-hosted + steps: + - name: Add claude to PATH + run: echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - uses: AgentsKit-io/code-review-cli@main + with: + provider: 'claude-cli' # local claude -p — no API cost + claude-oauth-token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + max-files: '25' + # advisory by default (posts only). To gate merges: + # fail-on-block: 'true' + # block: 'high'