此版本的 GitHub Enterprise Server 已于以下日期停止服务 2026-06-02. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持。
从命令行进行扫描
使用 CodeQL CLI 命令行运行代码扫描,以配置扫描、自定义查询和排查结果问题。
设置 CodeQL CLI
要开始使用 CodeQL CLI,您需要下载并设置 CLI,以便 CLI 能够访问创建和分析数据库所需的工具和库。
编写 CodeQL CLI 的自定义查询
可以编写自己的 CodeQL 查询来查找特定的漏洞和错误。
发布及使用 CodeQL 包
共享或下载 CodeQL 包,然后分析 CodeQL 数据库。
Testing custom queries
Verify your custom CodeQL queries and catch breaking changes before they affect your code scanning results following new releases of the CodeQL CLI.
测试查询帮助文件
确保您的CodeQL查询帮助文件有效,可以将其预览为 Markdown。
从 GitHub 下载 CodeQL 数据库
通过添加现成的数据库来扩展覆盖范围 CodeQL CLI 。
查看 CodeQL CLI 源代码
直接从源代码中配置CodeQL CLI。
Using incremental analysis with the CodeQL CLI
Get faster CodeQL results on pull requests by analyzing only what changed. Incremental analysis can reduce scan times by up to 10x when you run the CodeQL CLI in your own CI/CD system.
在 CodeQL 配置文件中指定命令选项
通过将常用命令选项和自定义 CodeQL 包添加到 CodeQL 配置文件来节省时间。
创建 CodeQL CLI 数据库捆绑包
创建包含 CodeQL 故障排除信息的数据库捆绑包。