| title | Set code scanning merge protection | ||||||
|---|---|---|---|---|---|---|---|
| shortTitle | Set merge protection | ||||||
| intro | Secure your codebase by blocking pull requests that fail {% data variables.product.prodname_code_scanning %} checks. | ||||||
| permissions | {% data reusables.permissions.security-org-enable %} | ||||||
| product | {% data reusables.gated-features.code-scanning %} | ||||||
| versions |
|
||||||
| redirect_from |
|
||||||
| contentType | how-tos | ||||||
| category |
|
{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.repo-rulesets-settings %}
- Click New ruleset.
- To create a ruleset targeting branches, click New branch ruleset. {% data reusables.repositories.rulesets-general-step %} {% data reusables.repositories.rulesets-require-code-scanning-results %}
For more information about managing rulesets in a repository, see AUTOTITLE.
{% ifversion ghec or ghes %}
{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.access-ruleset-settings %}
- Click New ruleset.
- To create a ruleset targeting branches, click New branch ruleset. {% data reusables.repositories.rulesets-general-step %} {% data reusables.repositories.rulesets-require-code-scanning-results %}
For more information about managing rulesets for repositories in an organization, see AUTOTITLE.
{% endif %}
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 AUTOTITLE.