You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI-powered PR reviews using OpenRouter's language models. Get automated code reviews, suggestions, and vulnerability scanning on your pull requests.
4
4
5
+
## How It Works
6
+
7
+
1. When a PR is opened or updated, the action automatically runs
8
+
2. It analyzes the PR's diff using your chosen AI model
9
+
3. Posts a detailed analysis as a PR comment, including:
10
+
- Potential bugs and vulnerabilities
11
+
- Code improvement suggestions
12
+
- Performance implications
13
+
- Security concerns
14
+
- Best practices violations
15
+
- Overall score and final comments
16
+
17
+
Example PR comment:
18
+
19
+
```markdown
20
+
## OpenRouter AI Analysis
21
+
22
+
### Potential Issues
23
+
24
+
- The database query in `users.service.ts` isn't properly parameterized, creating a SQL injection risk
25
+
- Async operation in `handleSubmit()` lacks error handling
26
+
27
+
### Improvements Suggested
28
+
29
+
- Consider using prepared statements for database queries
30
+
- Add try/catch block around async operations
31
+
- Extract form validation logic into a separate utility
32
+
33
+
### Performance
34
+
35
+
- The `heavyComputation()` function could benefit from memoization
36
+
- Consider lazy loading for the imported analytics module
37
+
38
+
### Security Concerns
39
+
40
+
- API endpoint lacks input validation
41
+
- Sensitive data exposure in error logs
42
+
43
+
### Best Practices
44
+
45
+
- Follow consistent naming convention for interface props
46
+
- Add type annotations for function parameters
47
+
- Consider breaking down large component into smaller ones
48
+
49
+
### Overall score
50
+
51
+
⭐⭐⭐⭐ (4/5) - Good PR with some minor improvements needed. The code is well-structured but could benefit from additional security measures and error handling.
52
+
53
+
---
54
+
55
+
_Analyzed using anthropic/claude-2_
56
+
```
57
+
5
58
## ⚠️ Security First: Managing Secrets
6
59
7
60
This action requires an OpenRouter API key. **NEVER** commit API keys or sensitive data directly in your workflow files.
@@ -18,9 +71,9 @@ This action requires an OpenRouter API key. **NEVER** commit API keys or sensiti
18
71
19
72
The `GITHUB_TOKEN` is automatically provided by GitHub Actions - you don't need to set it up manually.
20
73
21
-
## Quick Start
74
+
## Complete Workflow Example
22
75
23
-
Create `.github/workflows/pr-review.yml` in your project:
76
+
Create `.github/workflows/pr-review.yml` in your project with all available options:
0 commit comments