Skip to main content

Upload was rejected because CodeQL default setup is enabled for code scanning

You cannot upload SARIF results generated by the CodeQL action or CodeQL CLI when default setup for code scanning is enabled. Check your configuration and decide whether to keep default setup or unblock SARIF upload.

이 문서의 내용

About this error

Upload with CodeQL results rejected due to "default setup"

This error is reported if a process attempts to upload a SARIF file containing results of CodeQL analysis to a repository where CodeQL default setup is enabled. This includes uploads using the REST API and the CodeQL CLI. SARIF uploads are blocked when CodeQL default setup is enabled to reduce the potential for users to be confused by seeing similar code scanning alerts generated by different systems.

You will only see this error for SARIF files that contain results created using CodeQL.

Confirming the cause of the error

  1. GitHub에서 리포지토리의 기본 페이지로 이동합니다.

  2. 리포지토리 이름 아래에서 Settings를 클릭합니다. "설정" 탭이 표시되지 않으면 드롭다운 메뉴를 선택한 다음 설정을 클릭합니다.

    탭을 보여 주는 리포지토리 헤더의 스크린샷. "설정" 탭이 진한 주황색 윤곽선으로 강조 표시됩니다.

  3. 사이드바의 "Security" 섹션에서 Advanced Security 를 클릭합니다.

  4. In the "Code Security" section of the page, next to "CodeQL analysis," click .

  5. If there is a Switch to advanced option, default setup is enabled for the repository.

Fixing the problem

Before you can fix the problem, you need to decide whether code scanning alerts from CodeQL analysis in this repository should be generated using default setup or uploaded from SARIF files.

Continuing to generate alerts using default setup

  1. Leave the repository settings as they are, with default setup enabled.
  2. Disable the process or processes that tried to upload SARIF files to the repository.

Disabling default setup to unblock SARIF upload

  1. In the "Code scanning" section of the page, next to "CodeQL analysis," from the menu select Disable CodeQL.
  2. 프로세스를 다시 실행하여 SARIF 파일을 업로드합니다. 이제 SARIF 파일이 code scanning에 대한 요구 사항을 충족하는 경우 성공합니다. 유효성 검사 및 code scanning에서 지원하는 형식에 대한 자세한 내용은 코드 검사에 대한 SARIF 지원을(를) 참조하세요.