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

76 lines
2.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
schedule:
- cron: "17 * * * *"
permissions:
contents: write
pull-requests: write
checks: write
statuses: read
issues: write
jobs:
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'
uses: ./.github/workflows/review-reusable.yml
secrets:
CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
with:
event_name: ${{ github.event_name }}
event_action: ${{ github.event.action }}
repository_owner: ${{ github.repository_owner }}
repository_name: ${{ github.event.repository.name }}
pull_number: ${{ github.event.pull_request.number || github.event.issue.number }}
commenter_login: ${{ github.event.comment.user.login || '' }}
comment_body: ${{ github.event.comment.body || '' }}
reviewer_login: ${{ github.event.review.user.login || '' }}
review_state: ${{ github.event.review.state || '' }}
review_commit_id: ${{ github.event.review.commit_id || '' }}
bot_name: github-actions[bot]
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' }}
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
review-schedule-recheck:
if: github.event_name == 'schedule'
uses: ./.github/workflows/review-reusable.yml
secrets:
CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
with:
event_name: schedule
event_action: schedule
repository_owner: ${{ github.repository_owner }}
repository_name: ${{ github.event.repository.name }}
pull_number: "1"
bot_name: github-actions[bot]
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' }}
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
run_schedule_recheck: "true"