Skip to main content

此版本的 GitHub Enterprise Server 将于以下日期停止服务 2026-03-17. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

Cannot enable CodeQL in a private repository

GitHub Advanced Security must be enabled in order to use code scanning on private repositories.

Confirm whether GitHub Advanced Security is enabled

  1. 在 GitHub 上,导航到存储库的主页面。

  2. 在仓库名称下,单击 “Settings”****。 如果看不到“设置”选项卡,请选择“”下拉菜单,然后单击“设置”。

    存储库标头的屏幕截图,其中显示了选项卡。 “设置”选项卡以深橙色边框突出显示。

  3. 在边栏的“Security”部分中,单击“ Code security and analysis”****。

  4. On the settings page, scroll down to "Advanced Security."

  5. If there is an associated and active Enable button, Advanced Security is available for this repository but not yet enabled.

  6. If use of GitHub Advanced Security is blocked by a policy, the Enable button is inactive and the owner of the policy is listed.

    "Screenshot of the Advanced Security" setting. The enterprise policy owner and the inactive "Enable" button are highlighted in dark orange.

Requesting access to GitHub Advanced Security

  1. In the "Advanced Security" settings, click the enterprise or organization name to display a list of users with access to edit the policy that controls access to GitHub Advanced Security. For more information, see 强制实施企业的代码安全性和分析策略.
  2. Follow your company's policy for requesting access to additional features.

Enabling GitHub Advanced Security

  1. Open the "Code security" settings page.
  2. Next to the "Advanced Security" feature, click Enable.
  3. Rerun code scanning.