Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions .github/workflows/self-test-current-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,39 @@ jobs:
self-test:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
steps:
- name: Checkout Current Branch
uses: actions/checkout@v4

- name: Check OPENAI_API_KEY
if: ${{ env.OPENAI_API_KEY == '' }}
run: echo "OPENAI_API_KEY is not set. Skip self-test run."
- name: Check LLM_API_KEY
if: ${{ env.LLM_API_KEY == '' }}
run: echo "LLM_API_KEY is not set. Skip self-test run."

- name: Run Action From Current Branch
if: ${{ env.OPENAI_API_KEY != '' }}
if: ${{ env.LLM_API_KEY != '' }}
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_api_key: ${{ env.OPENAI_API_KEY }}
openai_api_base: ${{ vars.OPENAI_API_BASE }}
# Provider 配置(新字段)
ai_provider: ${{ vars.LLM_PROVIDER_PROTOCOL }}
api_key: ${{ env.LLM_API_KEY }}
api_base: ${{ vars.LLM_API_BASE }}

# [可选] Planner 使用模型;默认 gpt-5.3-codex
# 可选值:任意可用模型名(字符串)
planner_model: ${{ vars.PLANNER_OPENAI_MODEL }}
planner_model: ${{ vars.PLANNER_MODEL }}

# [可选] SubAgent 使用模型;默认 gpt-5.3-codex
# 可选值:任意可用模型名(字符串)
reviewer_model: ${{ vars.DEFAULT_OPENAI_MODEL }}
reviewer_model: ${{ vars.DEFAULT_MODEL }}

openai_api_base_allowlist: |
api_base_allowlist: |
api.openai.com
zenmux.ai
opencode.ai
tokenhub.tencentmaas.com
api.lkeap.cloud.tencent.com

include: |
**/*.js
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ npm-debug.log*
.DS_Store

.env
.firecrawl
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: AI Code Review
uses: TiyAgents/code-review-agent-action@v2
uses: TiyAgents/code-review-agent-action@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
openai_api_base: ${{ vars.OPENAI_API_BASE }}
openai_api_base_allowlist: |
ai_provider: openai
api_key: ${{ secrets.OPENAI_API_KEY }}
api_base: ${{ vars.OPENAI_API_BASE }}
api_base_allowlist: |
api.openai.com
your-gateway.example.com
include: |
Expand All @@ -78,7 +79,6 @@ jobs:
**/*.min.js
planner_model: gpt-5.3-codex
reviewer_model: gpt-5.3-codex
llm_compatibility_mode: auto
review_dimensions: general,security,performance,testing
review_language: English
min_finding_confidence: 0.72
Expand All @@ -99,14 +99,18 @@ jobs:
| Name | Required | Default | Description |
| --- | --- | --- | --- |
| `github_token` | yes | - | GitHub token with review/comment write permissions |
| `openai_api_key` | no | env `OPENAI_API_KEY` | OpenAI API key |
| `openai_api_base` | no | env `OPENAI_API_BASE` | Optional custom OpenAI-compatible base URL |
| `openai_api_base_allowlist` | no | `api.openai.com` | Allowed hostnames for `openai_api_base` (HTTPS only) |
| `ai_provider` | no | `openai` | AI provider type: `openai`, `anthropic`, `google`, `mistral`, or `openai-compatible` |
| `api_key` | no | env `OPENAI_API_KEY` | API key for the selected AI provider |

This comment was marked as outdated.

| `api_base` | no | env `OPENAI_API_BASE` | Optional base URL for the AI provider API endpoint |
| `api_base_allowlist` | no | `api.openai.com` | Allowed hostnames for `api_base` (HTTPS only) |
| `openai_api_key` | no | - | **Deprecated**: use `api_key` |
| `openai_api_base` | no | - | **Deprecated**: use `api_base` |
| `openai_api_base_allowlist` | no | - | **Deprecated**: use `api_base_allowlist` |
| `include` | no | `**` | Include globs (comma/newline separated) |
| `exclude` | no | empty | Exclude globs (comma/newline separated) |
| `planner_model` | no | `gpt-5.3-codex` | Planner model |
| `reviewer_model` | no | `gpt-5.3-codex` | Subagent model |
| `llm_compatibility_mode` | no | `auto` | Structured-output compatibility mode: `auto`, `responses_json_schema`, `chat_json_schema`, `chat_json_object`, or `prompt_json` |
| `llm_compatibility_mode` | no | `auto` | **Deprecated**: AI SDK handles compatibility automatically |
| `review_dimensions` | no | `general,security,performance,testing` | Subagent dimensions |
| `review_language` | no | `English` | Preferred language for review comments and summary |
| `min_finding_confidence` | no | `0.72` | Keep only findings at or above this confidence (0-1) |
Expand Down
25 changes: 19 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Inline PR Review Agent

description: PR code review action using an OpenAI-compatible structured runtime with inline comments and summary updates.
description: PR code review action powered by AI SDK with multi-provider support (OpenAI, Anthropic, Google, Mistral, OpenAI-compatible) and structured output.

author: TiyAgents Team

Expand All @@ -12,16 +12,29 @@ inputs:
github_token:
description: GitHub token with pull-requests:write and issues:write permissions.
required: true
ai_provider:
description: AI provider type (openai|anthropic|google|mistral|openai-compatible).
required: false
default: openai
api_key:
description: API key for the selected AI provider.
required: false
api_base:
description: Optional base URL for the AI provider API endpoint.
required: false
openai_api_key:
description: OpenAI API key. Falls back to OPENAI_API_KEY env.
description: "[Deprecated: use api_key] OpenAI API key. Falls back to OPENAI_API_KEY env."
required: false
openai_api_base:
description: Optional OpenAI API base URL. Falls back to OPENAI_API_BASE env.
description: "[Deprecated: use api_base] Optional OpenAI API base URL. Falls back to OPENAI_API_BASE env."
required: false
openai_api_base_allowlist:
description: Comma/newline separated allowed hostnames for openai_api_base (HTTPS only).
api_base_allowlist:
description: Comma/newline separated allowed hostnames for api_base (HTTPS only).
required: false
default: api.openai.com
openai_api_base_allowlist:
description: "[Deprecated: use api_base_allowlist] Comma/newline separated allowed hostnames for api_base (HTTPS only)."
required: false
include:
description: Include globs (comma/newline separated).
required: false
Expand All @@ -39,7 +52,7 @@ inputs:
required: false
default: gpt-5.3-codex
llm_compatibility_mode:
description: Compatibility mode for OpenAI-compatible model APIs (auto|responses_json_schema|chat_json_schema|chat_json_object|prompt_json).
description: "[Deprecated: AI SDK handles compatibility automatically] Compatibility mode for OpenAI-compatible model APIs."
required: false
default: auto
review_dimensions:
Expand Down
26 changes: 13 additions & 13 deletions examples/example-consumer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,26 @@ jobs:

- name: Run AI Code Review Action
if: ${{ env.OPENAI_API_KEY != '' }}
uses: TiyAgents/code-review-agent-action@v2
uses: TiyAgents/code-review-agent-action@v3
with:
# [Required] GitHub token with pull-requests:write and issues:write permissions
github_token: ${{ secrets.GITHUB_TOKEN }}

# [Conditionally required] OpenAI key. If not provided here,
# it must be available via OPENAI_API_KEY environment variable
openai_api_key: ${{ env.OPENAI_API_KEY }}
# [Optional] AI provider type; default is openai
# Allowed values: openai, anthropic, google, mistral, openai-compatible
ai_provider: openai

# [Optional] OpenAI base URL; any OpenAI-compatible API base URL
# If omitted, default official base is used; can also come from OPENAI_API_BASE
openai_api_base: ${{ vars.OPENAI_API_BASE }}
# [Conditionally required] API key for the selected provider.
# If not provided here, falls back to openai_api_key input or OPENAI_API_KEY env
api_key: ${{ env.OPENAI_API_KEY }}

# [Optional] Allowed hosts for openai_api_base (comma/newline separated); default api.openai.com
# [Optional] Base URL for the AI provider API endpoint
# If omitted, default official base is used; can also come from OPENAI_API_BASE env
api_base: ${{ vars.OPENAI_API_BASE }}

# [Optional] Allowed hosts for api_base (comma/newline separated); default api.openai.com
# Required when using a custom OpenAI-compatible gateway host
openai_api_base_allowlist: |
api_base_allowlist: |
api.openai.com
your-gateway.example.com

Expand All @@ -61,10 +65,6 @@ jobs:
# Allowed values: any available model name (string)
reviewer_model: gpt-5.3-codex

# [Optional] Compatibility mode for OpenAI-compatible APIs; default is auto
# Allowed values: auto, responses_json_schema, chat_json_schema, chat_json_object, prompt_json
llm_compatibility_mode: auto

# [Optional] Review dimensions (comma or newline separated);
# default is general,security,performance,testing
# Suggested values: general, security, performance, testing
Expand Down
Loading
Loading