close-codescan
关闭 Code Scanning (CodeQL) 告警,需提供合理理由。当用户要求关闭 Code Scanning 告警、dismiss CodeQL 告警时触发。参数为告警编号。
来源信息
- 仓库
- ModelEngine-Group/fit-framework
- 最近来源活动
- 2026年3月4日 06:49
- 检测到的 SKILL.md 语言
- 中文
- 星标
- 2,117
- 分支
- 335
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- close-codescan
- description
- 关闭 Code Scanning (CodeQL) 告警,需提供合理理由。当用户要求关闭 Code Scanning 告警、dismiss CodeQL 告警时触发。参数为告警编号。
# 关闭 Code Scanning 告警
## 执行步骤
1. 获取告警信息:
```bash
gh api "repos/{owner}/{repo}/code-scanning/alerts/<alert-number>"
```
2. 展示告警详情(规则 ID、严重程度、源码位置、告警消息)。
3. 询问关闭理由:
1. 误报(False Positive)
2. 不会修复(Won't Fix)
3. 测试代码(Used in Tests)
4. 要求详细说明(最少 20 个字符)。
5. 最终确认后执行关闭:
```bash
gh api --method PATCH "repos/{owner}/{repo}/code-scanning/alerts/<alert-number>" -f state=dismissed -f dismissed_reason="<reason>" -f dismissed_comment="<comment>"
```
dismissed_reason 有效值: "false positive", "won't fix", "used in tests"
**注意**: 谨慎关闭高危告警,优先考虑修复源代码。建议先使用 analyze-codescan 进行详细分析。
在 GitHub 查看