11name : Cursor Code Review
22
33on :
4- pull_request :
4+ pull_request_target :
55 types : [opened, synchronize, reopened, ready_for_review]
66
7+ # Prevent multiple reviews running simultaneously on the same PR
8+ concurrency :
9+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+ cancel-in-progress : true
11+
712permissions :
813 pull-requests : write
914 contents : read
@@ -12,6 +17,7 @@ permissions:
1217jobs :
1318 code-review :
1419 runs-on : ubuntu-latest
20+ timeout-minutes : 15
1521 # Skip automated code review for draft PRs
1622 if : github.event.pull_request.draft == false
1723 steps :
@@ -20,12 +26,21 @@ jobs:
2026 with :
2127 fetch-depth : 0
2228 ref : ${{ github.event.pull_request.head.sha }}
29+ persist-credentials : false # Security: don't persist creds when checking out PR code
2330
2431 - name : Install Cursor CLI
2532 run : |
2633 curl https://cursor.com/install -fsS | bash
2734 echo "$HOME/.cursor/bin" >> $GITHUB_PATH
2835
36+ - name : Verify Cursor CLI installation
37+ run : |
38+ if ! command -v cursor-agent &> /dev/null; then
39+ echo "::error::cursor-agent not found after installation"
40+ exit 1
41+ fi
42+ cursor-agent --version || true
43+
2944 - name : Configure git identity
3045 run : |
3146 git config user.name "Cursor Agent"
3449 - name : Perform automated code review
3550 env :
3651 CURSOR_API_KEY : ${{ secrets.CURSOR_API_KEY }}
37- MODEL : gpt-5-codex
52+ MODEL : gpt-5.1 -codex
3853 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3954 BLOCKING_REVIEW : ${{ vars.BLOCKING_REVIEW || 'false' }}
4055 run : |
0 commit comments