Skip to main content

Upload fails because Code Security is disabled

You can only upload SARIF results to private or internal repositories where Code Security is enabled.

About this error

 Code Security or  Advanced Security not enabled
 Code Security or  Advanced Security blocked by a policy
403:  Code Security or  Advanced Security is not enabled

This error is reported if a process attempts to upload a SARIF file to a repository where Code Security is not enabled or where use of this feature is blocked by a policy.

You will only see this error for SARIF files that contain results created using CodeQL and for uploads to repositories with private or internal visibility. Code Security is enabled by default for all public repositories.

For information on how to confirm this error and fix the problem, see Error: " Code Security or Advanced Security must be enabled for this repository to use code scanning".