Automatically review all open PRs without the ai-reviewed label in the kubeopencode/kubeopencode repository.
- CronTask: Daily at 7:00 UTC (
deploy/crontask-pr-review.yaml) - Manual:
run daily PR review,review open PRs
Query GitHub for open PRs without the ai-reviewed label:
gh pr list --repo kubeopencode/kubeopencode --state open --json number,title,labels \
--jq '[.[] | select(.labels | map(.name) | index("ai-reviewed") | not)] | .[].number'If no PRs found, exit successfully with "No open PRs without ai-reviewed label found."
For each discovered PR:
-
Fetch PR details:
gh pr view ${PR_NUMBER} --repo kubeopencode/kubeopencode --json title,body,files,additions,deletions,commits -
Review the diff:
gh pr diff ${PR_NUMBER} --repo kubeopencode/kubeopencode -
Review for:
- Code correctness and potential bugs
- Error handling and edge cases
- Security vulnerabilities
- Style violations and consistency
- Performance concerns
- Test coverage
-
Submit review with inline comments:
gh api repos/kubeopencode/kubeopencode/pulls/${PR_NUMBER}/reviews \ -f event="COMMENT" \ -f body="## Review Summary [Your summary here] --- *Review by kubeopencode-agent*" \ -f 'comments[0][path]=path/to/file.go' \ -f 'comments[0][line]=42' \ -f 'comments[0][body]=Your inline comment'
If no issues found, submit a summary-only review (omit
commentsfields).
After review is submitted, add the label to prevent re-review:
gh pr edit ${PR_NUMBER} --repo kubeopencode/kubeopencode --add-label "ai-reviewed"- Use
COMMENTevent only — do NOT approve or request changes - Be constructive and specific in feedback
- Suggest code improvements with examples
- Always add the
ai-reviewedlabel after review - Write review comments in English