Skip to main content

Converting branch protections to rulesets

Use rulesets to gain clearer visibility and control over your repository protections while preserving their existing behavior.

누가 이 기능을 사용할 수 있나요?

People with admin access to a repository, or a custom role with the "edit repository rules" permission, can create, edit, and delete rulesets for a repository.

규칙 집합은 조직의 경우 GitHub Free 및 GitHub Free이 있는 공개 리포지토리에서 사용할 수 있으며, GitHub Pro, GitHub Team 및 GitHub Enterprise Cloud이 있는 공개 및 비공개 리포지토리에서도 사용할 수 있습니다. GitHub 계획을(를) 참조하세요.

푸시 규칙 집합은 내부 및 프라이빗 리포지토리의 계획과 푸시 규칙 집합을 사용하도록 설정된 리포지토리의 포크에 사용할 수 GitHub Team 있습니다.

About converting branch protections to rulesets

Rulesets give you clearer visibility and control over how protections apply to a repository. Unlike branch protection rules, multiple rulesets can apply to the same branch at the same time, and people with read access can view the active rulesets. This helps developers understand the rules that affect them and lets auditors review repository protections without administrator access.

To move your existing protections to this model, convert one branch protection rule at a time in a guided flow. GitHub generates one or more rulesets that preserve the original rule's behavior. You can preview the rulesets and verify the result before you remove the original branch protection rule.

For more information about rulesets, see 규칙 세트에 대한 정보.

Converting a branch protection rule to a ruleset

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

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

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

  3. 사이드바의 "Code and automation" 섹션에서 Branches를 클릭합니다.

  4. Under "Branch protection rules", find the rule you want to convert, then click Convert to ruleset.

  5. Set the ruleset name for each ruleset that will be created in this conversion.

  6. Review the "New behavior" section to understand what will change when you create the ruleset or rulesets.

  7. Optionally, to remove the original branch protection rule as part of the conversion, select Delete branch protection rule once migration is done.

  8. Click Create ruleset. If the conversion produces more than one ruleset, the button includes the number of rulesets, for example, Create 2 rulesets.

If you keep the original branch protection rule, it continues to protect matching branches. An Active ruleset is enforced alongside it, so changes must satisfy both.

참고

The conversion covers all branch protection types with the exception of the "Require conversation resolution before merging" setting. In branch protections, this setting exists on its own. In rulesets, conversation resolution is part of the pull request rule and only applies when that rule is enabled. As a result, this setting does not map one to one during conversion. See 규칙 세트에 사용 가능한 규칙.

The new ruleset has an Active status, which means that it is enforced as soon as it is created.

Deleting the original branch protection rule

After you convert a rule, return to the Branches settings page. If you did not opt to delete the branch protection rule during the conversion process and the new ruleset fully covers it, the listed rule displays the message "This rule is fully covered by rulesets and can be safely deleted", and a Delete button appears in place of the Convert to ruleset button.

Before you delete the original rule, we recommend confirming that the new ruleset behaves as you expect. When you are ready, click Delete to remove the branch protection rule.

Further reading