•  


Set code scanning merge protection - GitHub Docs
Skip to main content

Set code scanning merge protection

You can use rulesets to set code scanning merge protection for pull requests.

Who can use this feature?

Code scanning is available for all public repositories on GitHub.com. Code scanning is also available for private repositories owned by organizations that use GitHub Enterprise Cloud and have a license for GitHub Advanced Security. For more information, see " About GitHub Advanced Security ."

About using rulesets for code scanning merge protection

Notes:

  • This feature is currently in beta and subject to change.
  • Merge protection with rulesets is not related to status checks. For more information about status checks, see " About status checks ."
  • Merge protection with rulesets will not apply to merge queue groups or Dependabot pull requests analyzed by default setup.

You can use rulesets to prevent pull requests from being merged when one of the following conditions is met:

  • A required tool found a code scanning alert of a severity that is defined in a ruleset.

  • A required code scanning tool's analysis is still in progress.

  • A required code scanning tool is not configured for the repository.

For more information about code scanning alerts, see " About code scanning alerts ."

You can set merge protection with rulesets at the repository level, and for repositories configured with either default setup or advanced setup. You can also use the REST API to set merge protection with rulesets.

For more information about rulesets, see " About rulesets ."

Creating a merge protection ruleset for a repository

  1. On GitHub.com, navigate to the main page of the repository.

  2. Under your repository name, click Settings . If you cannot see the "Settings" tab, select the dropdown menu, then click Settings .

    Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.

  3. In the left sidebar, under "Code and automation," click Rules , then click Rulesets .

    Screenshot of the sidebar of the "Settings" page for a repository. The "Rules" sub-menu is expanded, and the "Rulesets" option is outlined in orange.

  4. Click New ruleset .

  5. To create a ruleset targeting branches, click New branch ruleset .

  6. Under "Ruleset name," type a name for the ruleset.

  7. Optionally, to change the default enforcement status, click Disabled and select an enforcement status. For more information about enforcement statuses, see " About rulesets ."

  8. Under "Branch protections", select Require code scanning results .

  9. Under "Required tools and alert thresholds", click Add tool and select a code scanning tool with the dropdown. For example, "CodeQL".

  10. Next to the name of a code scanning tool:

    • Click Alerts and select one of: None , Errors , Errors and Warnings or All .
    • Click Security alerts and select one of: None , Critical , High or higher , Medium or higher , or All .

    Screenshot of the "Required tools and alert thresholds" section of "Rulesets" settings.

For more information about alert severity and security severity levels, see " About code scanning alerts ."

For more information about managing rulesets in a repository, see " Managing rulesets for a repository ."

Creating a merge protection ruleset with the REST API

You can use the REST API to create a ruleset with the code_scanning rule, which allows you to define specific tools and set alert thresholds. For more information, see " REST API endpoints for rules ."

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본