Files
ghbot/.github/workflows/review.yml
T

58 lines
1.7 KiB
YAML

name: PR Review Bot
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
- ready_for_review
issue_comment:
types:
- created
pull_request_review:
types:
- submitted
permissions:
contents: write
pull-requests: write
checks: write
statuses: read
issues: write
jobs:
review:
name: bot-review
if: |
github.event_name == 'pull_request_target' ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request != null) ||
github.event_name == 'pull_request_review'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Install Codex CLI
run: npm install -g @openai/codex
- run: npm ci
- run: npm run build
- name: Remove stale review result
run: rm -f .review-result.json
- run: node dist/src/actions/runReview.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
CODEX_BASE_URL: ${{ vars.CODEX_BASE_URL || 'https://api.openai.com/v1' }}
CODEX_MODEL: ${{ vars.CODEX_MODEL || 'gpt-5.4' }}
CODEX_REASONING_EFFORT: ${{ vars.CODEX_REASONING_EFFORT || 'high' }}
BOT_NAME: github-actions[bot]
LENIENT_APPROVAL_USER: lezi-fun
AUTO_MERGE: ${{ vars.AUTO_MERGE || 'false' }}
MERGE_METHOD: ${{ vars.MERGE_METHOD || 'squash' }}
REQUIRE_CHECKS: ${{ vars.REQUIRE_CHECKS || 'true' }}
MAX_PATCH_CHARS: ${{ vars.MAX_PATCH_CHARS || '120000' }}
LOG_LEVEL: info