Skip to main content

Cannot enable CodeQL in a private repository

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

If you are on a GitHub Free or GitHub Pro plan, you can only use code scanning on repositories that are publicly available. To enable code scanning for private or internal repositories, you must upgrade to GitHub Team or GitHub Enterprise with GitHub Code Security and enable Code Security for the repository. For more information, see GitHub のプラン and GitHub Advanced Security について.

Confirm whether GitHub Code Security is enabled

  1. GitHub で、リポジトリのメイン ページに移動します。

  2. リポジトリ名の下にある [Settings] をクリックします。 [設定] タブが表示されない場合は、 [] ドロップダウン メニューを選び、 [設定] をクリックします。

    タブを示すリポジトリ ヘッダーのスクリーンショット。 [設定] タブが濃いオレンジ色の枠線で強調表示されています。

  3. サイドバーの [Security] セクションで、[ Advanced Security] をクリックします。

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

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

  6. If use of GitHub Code Security is blocked by a policy, " Disabled" is shown in place of the Enable button.

    "Screenshot of the Advanced Security" setting. The disabled option is highlighted in dark orange.

Requesting access to GitHub Code Security

  1. In the "Code 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 Code Security. For more information, see エンタープライズのコード セキュリティと分析のためのポリシーの適用.
  2. Follow your company's policy for requesting access to additional features.

Enabling GitHub Code Security

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