The Workflow
When a PR is opened or marked ready for review, this workflow:- Checks out the code.
- Installs Node.js and Cline CLI.
- Configures authentication (e.g., Anthropic, OpenAI).
- Runs Cline with a comprehensive system prompt to analyze the diff, context, and related issues using GitHub CLI (
gh). - Posts a detailed review comment with inline code suggestions.
Prerequisites
- GitHub repository with Actions enabled.
- AI Provider API Key (e.g., Anthropic, OpenRouter) added as a repository secret (e.g.,
ANTHROPIC_API_KEY). - GitHub Token (automatically provided by Actions as
GITHUB_TOKEN).
Setup
1. Create the Workflow File
Create a file named.github/workflows/cline-pr-review.yml in your repository:
Deep code review
Analyze the code changes. Look for:- Logic errors and edge cases
- Security vulnerabilities
- Performance issues
- adherence to patterns in the codebase
Submit Review
Post a single comprehensive comment summarizing your review. If you have specific code suggestions, use the GitHub API to post inline comments:pull-requests: write so Cline can post comments and inline reviews. contents: read ensures it can analyze the code but cannot push changes directly, providing a security boundary.
Authentication
auth command configures Cline in the CI environment without interactive prompts. You can switch providers (e.g., openai, openrouter) by changing the flags.
Autonomous Mode (--yolo)
--yolo flag tells Cline to run autonomously, executing commands without waiting for user approval. This is essential for CI/CD workflows.
Command Permissions
We explicitly restrict what commands Cline can run usingCLINE_COMMAND_PERMISSIONS. This ensures Cline can only use gh and git commands relevant to reviewing, preventing any accidental or malicious system modifications.
Customizing the Reviewer
The “System Prompt” passed to Cline in the final step is fully customizable. You can modify it to:- Enforce specific style guides.
- Focus on security vs. performance.
- Ask for specific types of feedback (e.g., “Roast my code” vs. “Be gentle”).

