About this error
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
-
On GitHub, navigate to the main page of the repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
-
In the "Security" section of the sidebar, click Code security and analysis.
-
Scroll down to "GitHub 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 "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."
- Follow your company's policy for requesting access to additional features.
Enabling GitHub Advanced Security
- In the "GitHub Advanced Security" settings, click Enable.
- Rerun code scanning.