diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 38e91d4..a98b8eb 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - run: go build -o review-bot ./cmd/review-bot # Self-review using native SAP AI Core provider - # Models must match SAP AI Core deployments (use 'anthropic--' prefix for Claude) + # Models must match SAP AI Core deployments review: runs-on: ubuntu-24.04 if: github.event_name == 'pull_request' @@ -33,6 +33,15 @@ jobs: - name: gpt token_secret: GPT_REVIEW_TOKEN model: gpt-5 + - name: gpt41 + token_secret: GPT_REVIEW_TOKEN + model: gpt-4.1 + - name: gpt5-mini + token_secret: GPT_REVIEW_TOKEN + model: gpt-5-mini + - name: gpt41-mini + token_secret: GPT_REVIEW_TOKEN + model: gpt-4.1-mini - name: security token_secret: SECURITY_REVIEW_TOKEN model: gpt-5 diff --git a/README.md b/README.md index 0060da8..97513f2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ AI-powered code review bot for Gitea pull requests. Fetches diff + context, send ## Features -- **Multi-provider**: OpenAI-compatible and Anthropic Messages API +- **Multi-provider**: OpenAI-compatible, Anthropic Messages API, and SAP AI Core - **Context-aware**: Fetches full file content, conventions, language patterns, CI status - **Smart budget**: Automatically trims context to fit model token limits - **Idempotent reviews**: Posts new review, then cleans up stale ones (one review per bot) @@ -168,16 +168,41 @@ Prints the review to CI logs without posting to the PR. Useful for testing promp llm-provider: anthropic ``` +### Using SAP AI Core + +For SAP environments with AI Core deployments, use the `aicore` provider for native authentication: + +```yaml +- uses: https://gitea.weiker.me/rodin/review-bot/.gitea/actions/review@v0.1.0 + with: + reviewer-token: ${{ secrets.REVIEW_TOKEN }} + reviewer-name: aicore-review + llm-model: anthropic--claude-4.6-sonnet # or gpt-5 + llm-provider: aicore + aicore-client-id: ${{ secrets.AICORE_CLIENT_ID }} + aicore-client-secret: ${{ secrets.AICORE_CLIENT_SECRET }} + aicore-auth-url: ${{ secrets.AICORE_AUTH_URL }} + aicore-api-url: ${{ secrets.AICORE_API_URL }} + aicore-resource-group: default +``` + +AI Core handles OAuth token management and deployment discovery automatically. Model names must match the deployment name in AI Core (e.g. `anthropic--claude-4.6-sonnet`, `gpt-5`). + ## Action Inputs | Input | Required | Default | Description | |-------|----------|---------|-------------| | `reviewer-token` | Yes | — | Gitea token for posting reviews (needs `write:issue`, `write:repository`) | | `reviewer-name` | No | `""` | Logical identity for this reviewer. Used as sentinel for idempotent cleanup. Set this when running multiple review bots on the same PR. | -| `llm-base-url` | Yes | — | LLM API base URL | -| `llm-api-key` | Yes | — | LLM API key | +| `llm-base-url` | No* | `""` | LLM API base URL (required unless using aicore provider) | +| `llm-api-key` | No* | `""` | LLM API key (required unless using aicore provider) | | `llm-model` | Yes | — | Model name | -| `llm-provider` | No | `openai` | API provider: `openai` or `anthropic` | +| `llm-provider` | No | `openai` | API provider: `openai`, `anthropic`, or `aicore` | +| `aicore-client-id` | No** | `""` | SAP AI Core client ID | +| `aicore-client-secret` | No** | `""` | SAP AI Core client secret | +| `aicore-auth-url` | No** | `""` | SAP AI Core authentication URL | +| `aicore-api-url` | No** | `""` | SAP AI Core API URL | +| `aicore-resource-group` | No | `default` | SAP AI Core resource group | | `conventions-file` | No | `""` | Path to coding conventions file in the repo | | `patterns-repo` | No | `""` | Comma-separated repos with language patterns (e.g. `rodin/go-patterns`) | | `patterns-files` | No | `README.md` | Files/directories to fetch from pattern repos | @@ -188,6 +213,9 @@ Prints the review to CI logs without posting to the PR. Useful for testing promp | `update-existing` | No | `true` | Delete previous review from same bot before posting. Accepts: true/1/yes or false/0/no | | `version` | No | `latest` | review-bot version to install | +*Required for `openai` and `anthropic` providers, not for `aicore`. +**Required only for `aicore` provider. + ## Runner Requirements The composite action requires these tools on the runner: