已合并
chore: 接入 semgrep 敏感信息扫描钩子 #19
chore: 接入 semgrep 敏感信息扫描钩子 #19
已合并
masiyu创建于 15 天前
共 3 个文件变更+4-2
@@ -44,6 +44,6 @@ stages:
44 name: CI门禁44 name: CI门禁
45 select: selected_by_default45 select: selected_by_default
46 jobs:46 jobs:
47- Build:47+ CI:
48 name: CI门禁48 name: CI门禁
49 uses: openubmc/openubmc-ci/.gitcode/workflows/ci-build.yml@main49 uses: openubmc/openubmc-ci/.gitcode/workflows/ci-build.yml@main
@@ -1,12 +1,13 @@
1repos:1repos:
2 - repo: https://gitcode.com/openUBMC/pre-commit-hooks2 - repo: https://gitcode.com/openUBMC/pre-commit-hooks
3- rev: 0.1.03+ rev: 0.1.4
4 hooks:4 hooks:
5 - id: conventional-commit5 - id: conventional-commit
6 - id: add-signoff-and-change-id6 - id: add-signoff-and-change-id
7 - id: check-sr7 - id: check-sr
8 - id: check-json8 - id: check-json
9 - id: check-yaml9 - id: check-yaml
10+ - id: semgrep
atomgit-bot
atomgit-botatomgit-bot15 天前

🔵 Low Priority

建议:在 CONTRIBUTING.md 的 pre-commit 钩子说明中补充 semgrep 条目,说明其仅对改动文件增量扫描、命中即阻断、规则集随 openUBMC/pre-commit-hooks 的 rev 升级;若本次确实不打算改文档,则应修正 PR 描述以免与提交内容不符。

likedislike
不准确?
10 - repo: https://gitcode.com/gh_mirrors/pr/pre-commit-hooks11 - repo: https://gitcode.com/gh_mirrors/pr/pre-commit-hooks
11 rev: v6.0.012 rev: v6.0.0
12 hooks:13 hooks:
@@ -27,6 +27,7 @@ pre-commit run --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
27- **check-sr**: 检查 .sr 文件27- **check-sr**: 检查 .sr 文件
28- **check-json**: 检查 JSON 文件28- **check-json**: 检查 JSON 文件
29- **check-yaml**: 检查 YAML 文件29- **check-yaml**: 检查 YAML 文件
30+- **semgrep**: 使用内置的 92 条敏感词/内部信息规则扫描,命中即阻断提交(仅扫描本次改动的文件(增量),不支持全量扫描;规则跟随钩子仓库统一升级,无需本仓配置)
30 31 
31**[pre-commit-hooks (mirrored)](https://gitcode.com/gh_mirrors/pr/pre-commit-hooks)**:32**[pre-commit-hooks (mirrored)](https://gitcode.com/gh_mirrors/pr/pre-commit-hooks)**:
32- **trailing-whitespace**: 修复行尾多余空白(排除 .vscode/)33- **trailing-whitespace**: 修复行尾多余空白(排除 .vscode/)