chore(hooks): dedupe .claude/.codex hooks and soften skill_guard #613
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |