Skip to main content

This version of GitHub Enterprise Server was discontinued on 2024-01-04. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise Server. For help with the upgrade, contact GitHub Enterprise support.

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. On your GitHub Enterprise Server instance, navigate to the main page of the repository.

  2. Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

    Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.

  3. In the "Security" section of the sidebar, click Code security and analysis.

  4. Scroll down to "GitHub Advanced Security."

  5. If there is an associated and active Enable button, GitHub 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 GitHub 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 "GitHub Advanced Security" settings, click the enterprise name to display a list of users with access to edit the policy that controls access to GitHub Advanced Security. For more information, see "Enforcing policies for code security and analysis for your enterprise."
  2. Follow your company's policy for requesting access to additional features.

Enabling GitHub Advanced Security

  1. In the "GitHub Advanced Security" settings, click Enable.
  2. Rerun code scanning.