About this error
GitHub Advanced Security must be enabled for this repository to use code scanning
403: GitHub Advanced Security is not enabled
This error is reported if you try to run code scanning in a repository where GitHub Advanced Security is not enabled or where use of this feature is blocked by a policy.
Confirming the cause of the error
-
在 GitHub 上,导航到存储库的主页面。
-
在仓库名称下,单击 “Settings”****。 如果看不到“设置”选项卡,请选择“”下拉菜单,然后单击“设置”。

-
在边栏的“Security”部分中,单击“ Code security and analysis”****。
-
On the settings page, scroll down to "Advanced Security."
-
If there is an associated and active Enable button, GitHub Advanced Security is available for this repository but not yet enabled.
-
If use of GitHub Advanced Security is blocked by a policy, the Enable button is inactive and the owner of the policy is listed.

Fixing the problem
If GitHub Advanced Security is available to your repository, you can enable it on the settings page.
If GitHub Advanced Security is blocked by a policy, you first need to request access.
Requesting access to GitHub Advanced Security
- In the "Code security and analysis" settings, click the enterprise name to display a list of users with access to edit the policy that controls access to Advanced Security products. For more information, see 强制实施企业的代码安全性和分析策略.
- Follow your company's policy for requesting access to additional features.
Enabling GitHub Advanced Security
- Open the "Code security" settings page.
- Next to the "Advanced Security" feature, click Enable.
- Rerun code scanning.