Close Codescan
DevOps & Securityclose-codescanClose Codescan is an Agent Skill for devops & security published in the ModelEngine-Group/fit-framework repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
关闭 Code Scanning (CodeQL) 告警,需提供合理理由。当用户要求关闭 Code Scanning 告警、dismiss CodeQL 告警时触发。参数为告警编号。
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/ModelEngine-Group/fit-framework/blob/HEAD/.agents/skills/close-codescan/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/close-codescan, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
关闭 Code Scanning 告警
执行步骤
-
获取告警信息:
gh api "repos/{owner}/{repo}/code-scanning/alerts/<alert-number>" -
展示告警详情(规则 ID、严重程度、源码位置、告警消息)。
-
询问关闭理由:
- 误报(False Positive)
- 不会修复(Won't Fix)
- 测试代码(Used in Tests)
-
要求详细说明(最少 20 个字符)。
-
最终确认后执行关闭:
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 进行详细分析。