ci: add PR review workflow with high-risk detection#126
Conversation
- Auto-detect high-risk patterns (webhook, auth, token, secrets, plugin config) - Add high-risk label and require manual review - PR review checklist for all PRs
Jerry-Xin
left a comment
There was a problem hiding this comment.
Nice idea to add automated high-risk detection! A few suggestions to make it more robust:
-
Duplicate comment issue: Both steps trigger on
synchronize(new pushes), which means every force-push or new commit will create duplicate comments. Consider checking if a similar comment already exists before posting, or switch to using a single comment that gets updated viaissues.updateComment. -
Regex false positives: Patterns like
/auth/iand/token/iare quite broad — they would match file names likeauthor.tsortokenizer.go. Consider word-boundary patterns (/\bauth\b/i) or limiting the scan to specific directories/extensions. -
Review checklist scope: The checklist is posted on every PR unconditionally. For doc-only or CI-only changes, the webhook/token checklist items are not relevant. Consider making it conditional based on changed file types, or merge it into the high-risk step.
Overall good direction for the project — just needs dedup logic to avoid noisy PRs. 👍
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize] |
There was a problem hiding this comment.
The synchronize event fires on every push to the PR branch. Both steps below will create new comments each time, which can spam the PR. Consider checking for an existing bot comment and updating it instead of creating a new one.
| /token/i, | ||
| /secret/i, | ||
| /\.env/, | ||
| /openclaw\.plugin\.json/, |
There was a problem hiding this comment.
These patterns are quite broad. For example, /auth/i will match filenames containing "author", "authorization-docs", etc. Consider using word-boundary anchors like /\bauth\b/i to reduce false positives.
| labels: ['high-risk'], | ||
| }); | ||
| } | ||
|
|
There was a problem hiding this comment.
This checklist is posted unconditionally on every PR event. Two issues: (1) it creates duplicate comments on each push, and (2) the checklist items are not always relevant (e.g., doc-only PRs). Consider deduplicating and/or making this conditional based on changed file types.
What
为 dmwork-adapters 添加 PR review 自动化。
Why
唯一有完整 CI 的项目,但缺少 PR review 自动化。其他项目都有高风险检测,adapters 也应该有。
How
high-risklabel + 要求人工 review