Skip to content
Open
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
31 changes: 13 additions & 18 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,24 @@ permissions:

on:
pull_request_target: # Handle forked repository PRs in the base repository context
types: [opened, synchronize]
pull_request_review_comment: # Handle review comments
types: [created]
types: [opened, synchronize, reopened, ready_for_review]

jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Check required secrets
run: |
if [ -z "${{ secrets.LLM_API_KEY }}" ]; then
echo "Error: LLM_API_KEY secret is not configured"
exit 1
fi

- name: Check out PR code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run AI Reviewer
- name: Run AI code reviewer
uses: presubmit/ai-reviewer@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_MODEL: "gemini-1.5-flash"
LLM_PROVIDER: ai-sdk
LLM_MODEL: gemini-1.5-flash-latest # ✅ Updated model
REVIEW_SUMMARY: "true"
MAX_TOKENS: "4096"
Comment on lines +20 to +26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block configures the AI reviewer task. However, ensure the env block is properly formed under the step (use env: with a mapping of variables). The snippet currently shows an 'env' line with a possible formatting issue (env + LLM_PROVIDER...). Correct it to:\n env:\n LLM_PROVIDER: ai-sdk\n LLM_MODEL: gemini-1.5-flash-latest\n REVIEW_SUMMARY: "true"\n MAX_TOKENS: "4096"\n TEMPERATURE: "0.2"

TEMPERATURE: "0.2"

- name: Print completion message
run: echo "✅ AI code review completed successfully!"
Loading