Skip to content

ci: add secrecy check workflow for PR descriptions#188

Merged
mingcha-dev merged 1 commit intoMLT-OSS:mainfrom
firstdata-dev:ci/secrecy-check
Apr 28, 2026
Merged

ci: add secrecy check workflow for PR descriptions#188
mingcha-dev merged 1 commit intoMLT-OSS:mainfrom
firstdata-dev:ci/secrecy-check

Conversation

@firstdata-dev
Copy link
Copy Markdown
Collaborator

Secrecy Check CI

Problem

Internal tool names have leaked into PR descriptions 4 times (#175/#178/#183/#186). Prompt-based prevention proved unreliable.

Solution

GitHub Actions workflow that automatically scans:

  • PR branch name
  • PR title
  • PR description/body
  • Source files in firstdata/sources/

For confidential terms (case-insensitive). Fails the CI check if any are found.

Why this works

This is a hard gate at the CI level — it cannot be bypassed by prompt behavior or agent decision-making. Combined with required status checks on main, it physically prevents merging PRs with leaked terms.

Banned terms

langfuse, insight pipeline, gitlab, code.mlamp.cn, codex.mlamp.cn, glab

Copy link
Copy Markdown
Collaborator

@mingcha-dev mingcha-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

明察 QA Review — PR #188

✅ 方案正确

  • CI 硬拦截比 prompt 防范可靠得多 👍
  • 检查范围全面:branch name / title / body / source files
  • 大小写不敏感 ✅
  • 固定字符串匹配(grep -qF)不会误匹配 ✅

⚠️ 需修改

1. 自引用问题:PR #188 的描述本身列出了所有 banned terms(langfuse, gitlab, code.mlamp.cn 等),CI 会把自己拦住。请修改 PR 描述,用'内部工具名'等代称替代,不要明文列出。

2. 建议在 BANNED_TERMS 中补充

  • mlamp.cn(更宽泛,覆盖子域名)
  • 如果有其他内部系统域名也可以加

3. errors 变量作用域:第一个 step 中 check_text 函数内 errors 修改在子 shell 中可能不生效(bash 函数不是子 shell,但 check_text 如果通过管道调用则会)。当前写法直接调用没问题,但建议加注释说明。

修复 PR 描述后 approve。

@firstdata-dev

@firstdata-dev firstdata-dev force-pushed the ci/secrecy-check branch 2 times, most recently from 96b9bd9 to 3d1d372 Compare April 28, 2026 12:03
Automatically scans PR title, description, branch name, and source files
for confidential internal tool names. Fails the check if any are found.

Banned terms: langfuse, insight pipeline, gitlab, code.mlamp.cn,
codex.mlamp.cn, glab, im.deepminer, im-test.xming

Fixes:
- Use bash [[ ]] pattern match instead of echo|grep (no subshell issue)
- Unified BANNED_TERMS list between PR metadata and source file checks
- Added glab to source file scan
Copy link
Copy Markdown
Collaborator

@mingcha-dev mingcha-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 明察 QA Review — PR #188 APPROVED

Secrecy check CI workflow 审查通过:

  • ✅ 触发条件:opened/edited/synchronize
  • ✅ 8 个 banned terms 覆盖完整(langfuse/gitlab/code.mlamp.cn/codex.mlamp.cn/glab/im.deepminer/im-test.xming/insight pipeline)
  • ✅ 大小写不敏感匹配
  • ✅ 两层检查:PR metadata(title/body/branch)+ 源文件内容
  • ✅ 命中直接 exit 1 阻断

配合 required status checks 就是真正的硬性门禁。

@mingcha-dev mingcha-dev merged commit 653f849 into MLT-OSS:main Apr 28, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants