Skip to content

refactor(cli): finalize main.js thin-dispatcher after rebase recovery #616

refactor(cli): finalize main.js thin-dispatcher after rebase recovery

refactor(cli): finalize main.js thin-dispatcher after rebase recovery #616

Workflow file for this run

name: Code Review
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review, labeled]
permissions:
contents: read
pull-requests: write
# Code review runs OpenAI API calls — cancel superseded runs on the
# same PR so rapid pushes don't fan-out the model bill.
concurrency:
group: cr-${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
review:
# Draft PRs and automated agent-lane PRs (head branch `agent/*`)
# skip review. The agent flow lands hundreds of PRs per month; AI
# review on each one burns both Actions minutes and OpenAI tokens
# without adding signal. Human-authored PRs (any non-`agent/*`
# head branch) still get reviewed; agent PRs opt-in by applying
# the `needs-review` label.
if: >-
github.event.pull_request.draft == false &&
(
!startsWith(github.event.pull_request.head.ref, 'agent/') ||
contains(github.event.pull_request.labels.*.name, 'needs-review') ||
(github.event.action == 'labeled' && github.event.label.name == 'needs-review')
)
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
steps:
- name: Skip when OPENAI_API_KEY is missing
if: ${{ env.OPENAI_API_KEY == '' }}
run: echo "OPENAI_API_KEY is not configured; skipping Code Review workflow."
- uses: anc95/ChatGPT-CodeReview@1e3df152c1b85c12da580b206c91ad343460c584 # v1.0.23
if: ${{ env.OPENAI_API_KEY != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ env.OPENAI_API_KEY }}
OPENAI_API_ENDPOINT: https://api.openai.com/v1
MODEL: gpt-4o-mini