@theihtisham/review-agent 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +352 -0
- package/__tests__/config.test.ts +99 -0
- package/__tests__/diff-parser.test.ts +137 -0
- package/__tests__/fixtures/mock-data.ts +120 -0
- package/__tests__/llm-client.test.ts +166 -0
- package/__tests__/rate-limiter.test.ts +95 -0
- package/__tests__/security-utils.test.ts +152 -0
- package/__tests__/security.test.ts +138 -0
- package/action.yml +65 -0
- package/dist/index.js +55824 -0
- package/dist/sourcemap-register.js +1 -0
- package/package.json +46 -0
- package/src/config.ts +201 -0
- package/src/conventions.ts +288 -0
- package/src/github.ts +180 -0
- package/src/llm-client.ts +210 -0
- package/src/main.ts +106 -0
- package/src/reviewer.ts +161 -0
- package/src/reviewers/security.ts +205 -0
- package/src/types.ts +114 -0
- package/src/utils/diff-parser.ts +177 -0
- package/src/utils/rate-limiter.ts +72 -0
- package/src/utils/security.ts +125 -0
- package/tsconfig.json +34 -0
- package/vitest.config.ts +16 -0
package/action.yml
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: "ReviewAgent - AI Code Review"
|
|
2
|
+
description: "AI-powered code review that posts line-by-line review comments on PRs. Catches bugs, security holes, performance issues, and style violations."
|
|
3
|
+
author: "ReviewAgent"
|
|
4
|
+
branding:
|
|
5
|
+
icon: "eye"
|
|
6
|
+
color: "purple"
|
|
7
|
+
|
|
8
|
+
inputs:
|
|
9
|
+
github-token:
|
|
10
|
+
description: "GitHub token for API access. Use secrets.GITHUB_TOKEN or a PAT."
|
|
11
|
+
required: true
|
|
12
|
+
llm-provider:
|
|
13
|
+
description: "LLM provider to use: openai, anthropic, or ollama"
|
|
14
|
+
required: false
|
|
15
|
+
default: "openai"
|
|
16
|
+
llm-api-key:
|
|
17
|
+
description: "API key for the LLM provider. For Ollama, this can be omitted. Store as a GitHub secret."
|
|
18
|
+
required: false
|
|
19
|
+
default: ""
|
|
20
|
+
llm-model:
|
|
21
|
+
description: "Model name to use (e.g., gpt-4o, claude-sonnet-4-20250514, llama3.1)"
|
|
22
|
+
required: false
|
|
23
|
+
default: "gpt-4o"
|
|
24
|
+
llm-base-url:
|
|
25
|
+
description: "Custom base URL for the LLM API. Required for Ollama or self-hosted endpoints."
|
|
26
|
+
required: false
|
|
27
|
+
default: ""
|
|
28
|
+
config-path:
|
|
29
|
+
description: "Path to .reviewagent.yml config file in the repo"
|
|
30
|
+
required: false
|
|
31
|
+
default: ".reviewagent.yml"
|
|
32
|
+
severity:
|
|
33
|
+
description: "Minimum severity to report: critical, warning, info"
|
|
34
|
+
required: false
|
|
35
|
+
default: "warning"
|
|
36
|
+
max-comments:
|
|
37
|
+
description: "Maximum number of review comments to post per PR"
|
|
38
|
+
required: false
|
|
39
|
+
default: "50"
|
|
40
|
+
review-type:
|
|
41
|
+
description: "Type of GitHub review to submit: approve, request-changes, or comment"
|
|
42
|
+
required: false
|
|
43
|
+
default: "comment"
|
|
44
|
+
language-hints:
|
|
45
|
+
description: "Comma-separated language hints for the reviewer (e.g., 'typescript,python')"
|
|
46
|
+
required: false
|
|
47
|
+
default: ""
|
|
48
|
+
learn-conventions:
|
|
49
|
+
description: "Whether to learn repo conventions from existing code"
|
|
50
|
+
required: false
|
|
51
|
+
default: "true"
|
|
52
|
+
|
|
53
|
+
outputs:
|
|
54
|
+
review-id:
|
|
55
|
+
description: "The ID of the submitted GitHub review"
|
|
56
|
+
comments-posted:
|
|
57
|
+
description: "Number of review comments posted"
|
|
58
|
+
score:
|
|
59
|
+
description: "Overall code quality score (0-100)"
|
|
60
|
+
summary:
|
|
61
|
+
description: "Short summary of the review findings"
|
|
62
|
+
|
|
63
|
+
runs:
|
|
64
|
+
using: "node20"
|
|
65
|
+
main: "dist/index.js"
|