proof-pr 0.1.6 → 0.1.8
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/README.md +43 -16
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1085 -10
- package/dist/index.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,40 +1,67 @@
|
|
|
1
1
|
# proof-pr
|
|
2
2
|
|
|
3
|
-
ProofPR
|
|
3
|
+
ProofPR 是给开源维护者和工程团队使用的 PR 证据门禁。它在投入深度 review 之前,先检查 PR 是否提供了足够证据:测试、复现、截图、changelog、权限理由,以及是否触碰敏感路径、依赖、workflow、MCP 或 secret 风险。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
它不依赖大模型,不上传代码,只基于 diff、PR 描述和配置做确定性判断。
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 快速使用
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
初始化配置和 GitHub Action:
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## 使用
|
|
11
|
+
```bash
|
|
12
|
+
npx proof-pr@latest init --preset open-source-maintainer
|
|
13
|
+
```
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
本地扫描当前分支:
|
|
17
16
|
|
|
18
17
|
```bash
|
|
19
|
-
npx proof-pr@latest init
|
|
20
|
-
npx proof-pr@latest init --preset security-strict
|
|
21
|
-
npx proof-pr@latest scan --base origin/main --head HEAD
|
|
22
18
|
npx proof-pr@latest scan --base origin/main --head HEAD --locale zh-CN
|
|
23
|
-
npx proof-pr@latest scan --base origin/main --pr-body-file pr-body.md --format json
|
|
24
19
|
```
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
扫描内置案例:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx proof-pr@latest scan --diff-file examples/cases/workflow-untrusted-checkout.diff --locale zh-CN
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
生成独立 HTML 可视化报告:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx proof-pr@latest scan --base origin/main --head HEAD --locale zh-CN --format html > proofpr-report.html
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
运行 benchmark:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx proof-pr@latest benchmark --cases benchmarks/cases
|
|
37
|
+
```
|
|
27
38
|
|
|
28
39
|
## GitHub Action
|
|
29
40
|
|
|
30
41
|
```yaml
|
|
31
|
-
- uses: linsk27/proof-pr@v0.1.
|
|
42
|
+
- uses: linsk27/proof-pr@v0.1.8
|
|
32
43
|
with:
|
|
33
44
|
fail-on: high
|
|
34
45
|
comment: "true"
|
|
35
46
|
annotations: "true"
|
|
36
47
|
```
|
|
37
48
|
|
|
38
|
-
|
|
49
|
+
## 输出什么
|
|
50
|
+
|
|
51
|
+
- 风险等级:`low`、`medium`、`high`。
|
|
52
|
+
- 证据评分:0-100 分。
|
|
53
|
+
- Review 门禁:正常 review、重点 review、先补证据、风险处理前不要合并。
|
|
54
|
+
- Review 行动清单:维护者可直接执行的 checklist。
|
|
55
|
+
- 可选输出:GitHub annotations、SARIF、benchmark report、独立 HTML 可视化报告。
|
|
56
|
+
|
|
57
|
+
## 常用预设
|
|
58
|
+
|
|
59
|
+
- `open-source-maintainer`:开源仓库推荐。
|
|
60
|
+
- `security-strict`:安全敏感项目。
|
|
61
|
+
- `ai-generated-pr`:AI 生成 PR 较多的仓库。
|
|
62
|
+
- `mcp-security`:关注 MCP / agent 配置。
|
|
63
|
+
- `dependency-careful`:关注依赖和锁文件变化。
|
|
64
|
+
|
|
65
|
+
完整中文文档、截图和从 0 到 1 教程见仓库 README:
|
|
39
66
|
|
|
40
67
|
https://github.com/linsk27/proof-pr
|
package/dist/index.d.ts
ADDED