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
Copy file name to clipboardExpand all lines: README.md
+52-67Lines changed: 52 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,73 +14,6 @@ AI-powered PR reviews using OpenRouter's language models. Get automated code rev
14
14
- Best practices violations
15
15
- Overall score and final comments
16
16
17
-
## Quick Start
18
-
19
-
Add this workflow to `.github/workflows/pr-review.yml`:
20
-
21
-
```yaml
22
-
name: PR Review
23
-
on:
24
-
pull_request:
25
-
types: [opened, synchronize]
26
-
27
-
# Add these permissions to allow PR comments
28
-
permissions:
29
-
contents: read
30
-
pull-requests: write
31
-
32
-
jobs:
33
-
review:
34
-
runs-on: ubuntu-latest
35
-
steps:
36
-
- uses: actions/checkout@v3
37
-
- uses: jonit-dev/openrouter-github-action@main
38
-
with:
39
-
github_token: ${{ secrets.GITHUB_TOKEN }}
40
-
open_router_key: ${{ secrets.OPEN_ROUTER_KEY }}
41
-
```
42
-
43
-
## Example PR Comment
44
-
45
-
```markdown
46
-
## DiffGuard AI Analysis
47
-
48
-
### Potential Issues
49
-
50
-
- The database query in `users.service.ts` isn't properly parameterized, creating a SQL injection risk
51
-
- Async operation in `handleSubmit()` lacks error handling
52
-
53
-
### Improvements Suggested
54
-
55
-
- Consider using prepared statements for database queries
56
-
- Add try/catch block around async operations
57
-
- Extract form validation logic into a separate utility
58
-
59
-
### Performance
60
-
61
-
- The `heavyComputation()` function could benefit from memoization
62
-
- Consider lazy loading for the imported analytics module
63
-
64
-
### Security Concerns
65
-
66
-
- API endpoint lacks input validation
67
-
- Sensitive data exposure in error logs
68
-
69
-
### Best Practices
70
-
71
-
- Follow consistent naming convention for interface props
72
-
- Add type annotations for function parameters
73
-
- Consider breaking down large component into smaller ones
74
-
75
-
### Overall score
76
-
77
-
⭐⭐⭐⭐ (4/5) - Good PR with some minor improvements needed. The code is well-structured but could benefit from additional security measures and error handling.
78
-
79
-
---
80
-
81
-
_Analyzed using anthropic/claude-2_
82
-
```
83
-
84
17
## ⚠️ Security First: Managing Secrets
85
18
86
19
This action requires an OpenRouter API key. **NEVER** commit API keys or sensitive data directly in your workflow files.
@@ -141,6 +74,58 @@ jobs:
141
74
Provide a 1-5 star rating for the overall quality.
142
75
```
143
76
77
+
## Building the Project
78
+
79
+
After making changes to the action's code, you need to build the project to update the action:
80
+
81
+
1. Run the following command to install dependencies and build the action:
82
+
```bash
83
+
npm install && npm run build
84
+
```
85
+
86
+
This will compile the code and prepare it for use in GitHub Actions.
87
+
88
+
## Example PR Comment
89
+
90
+
```markdown
91
+
## OpenRouter AI Analysis
92
+
93
+
### Potential Issues
94
+
95
+
- The database query in `users.service.ts` isn't properly parameterized, creating a SQL injection risk
96
+
- Async operation in `handleSubmit()` lacks error handling
97
+
98
+
### Improvements Suggested
99
+
100
+
- Consider using prepared statements for database queries
101
+
- Add try/catch block around async operations
102
+
- Extract form validation logic into a separate utility
103
+
104
+
### Performance
105
+
106
+
- The `heavyComputation()` function could benefit from memoization
107
+
- Consider lazy loading for the imported analytics module
108
+
109
+
### Security Concerns
110
+
111
+
- API endpoint lacks input validation
112
+
- Sensitive data exposure in error logs
113
+
114
+
### Best Practices
115
+
116
+
- Follow consistent naming convention for interface props
117
+
- Add type annotations for function parameters
118
+
- Consider breaking down large component into smaller ones
119
+
120
+
### Overall score
121
+
122
+
⭐⭐⭐⭐ (4/5) - Good PR with some minor improvements needed. The code is well-structured but could benefit from additional security measures and error handling.
0 commit comments