Skip to content

Commit af38271

Browse files
committed
chore(ci): fix cursor
Signed-off-by: Tommy Nguyen <tuannvm@hotmail.com>
1 parent a870643 commit af38271

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/cursor.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
BLOCKING_REVIEW: ${{ vars.BLOCKING_REVIEW || 'false' }}
4040
run: |
41-
cursor-agent --force --model "$MODEL" --output-format=text --print 'You are operating in a GitHub Actions runner performing automated code review. The gh CLI is available and authenticated via GH_TOKEN. You may comment on pull requests.
41+
PROMPT=$(cat <<'EOF'
42+
You are operating in a GitHub Actions runner performing automated code review. The gh CLI is available and authenticated via GH_TOKEN. You may comment on pull requests.
4243
4344
Context:
4445
- Repo: ${{ github.repository }}
@@ -92,10 +93,20 @@ jobs:
9293
- Do NOT use: gh pr review --approve or --request-changes
9394
9495
Blocking behavior:
95-
- If BLOCKING_REVIEW is true and any 🚨 or 🔒 issues were posted: echo "CRITICAL_ISSUES_FOUND=true" >> $GITHUB_ENV
96-
- Otherwise: echo "CRITICAL_ISSUES_FOUND=false" >> $GITHUB_ENV
97-
- Always set CRITICAL_ISSUES_FOUND at the end
98-
'
96+
- At the end, print exactly one line: CRITICAL_ISSUES_FOUND=true or CRITICAL_ISSUES_FOUND=false
97+
- Set to true if BLOCKING_REVIEW is true and you posted any 🚨 or 🔒 issues
98+
- Set to false otherwise
99+
EOF
100+
)
101+
102+
OUTPUT=$(cursor-agent --force --model "$MODEL" --output-format=text --print "$PROMPT" 2>&1)
103+
echo "$OUTPUT"
104+
105+
if echo "$OUTPUT" | grep -q "CRITICAL_ISSUES_FOUND=true"; then
106+
echo "CRITICAL_ISSUES_FOUND=true" >> $GITHUB_ENV
107+
else
108+
echo "CRITICAL_ISSUES_FOUND=false" >> $GITHUB_ENV
109+
fi
99110
100111
- name: Check blocking review results
101112
if: env.BLOCKING_REVIEW == 'true'

0 commit comments

Comments
 (0)