참고
The rule to require secret scanning alerts to be resolved before merging is in 공개 미리 보기 and subject to change.
The Require secret scanning alerts are resolved rule is available for rulesets that target branches in repositories. You can use the rule to block a pull request from merging when either of these conditions applies:
- A secret scanning scan has not completed for the head commit of the pull request.
- A commit in the pull request introduced an open secret scanning alert that matches a secret type selected in the ruleset.
The rule supports provider, custom, and generic patterns. It does not support AI-detected secrets.
Prerequisites
The repositories that you want to protect must have:
- Either GitHub Secret Protection or GitHub Advanced Security enabled
- Secret scanning enabled. See 리포지토리의 비밀 스캔 활성화.
Creating a merge protection ruleset for a repository
-
GitHub에서 리포지토리의 기본 페이지로 이동합니다.
-
리포지토리 이름 아래에서 Settings를 클릭합니다. "설정" 탭이 표시되지 않으면 드롭다운 메뉴를 선택한 다음 설정을 클릭합니다.

-
왼쪽 사이드바의 "코드 및 자동화"에서 규칙 집합을 클릭한 다음 규칙 집합을 클릭합니다.
-
Click New ruleset.
-
Click New branch ruleset.
-
"규칙 집합 이름" 아래에 규칙 집합의 이름을 입력합니다.
-
필요에 따라 기본 적용 상태를 변경하려면 Disabled 를 클릭하고 적용 상태를 선택합니다. 분기 또는 태그를 대상으로 지정하려면 "대상 분기" 또는 "대상 태그" 섹션에서 대상 추가를 선택한 다음 분기 또는 태그를 포함하거나 제외할 방법을 선택합니다.
fnmatch구문을 사용하여 패턴에 따라 분기 또는 태그를 포함하거나 제외할 수 있습니다. 자세한 내용은fnmatch구문 사용을 참조하세요.
동일한 규칙 세트에 여러 대상 지정 조건을 추가할 수 있습니다. 예를 들어 기본 분기를 포함하고 *feature* 패턴과 일치하는 분기를 포함한 다음, not-a-feature 패턴과 일치하는 분기를 명시적으로 제외할 수 있습니다.
- Under "Branch protections", select Require secret scanning alerts are resolved.
- Under "Secret types", select one or more types of secrets that should block merging:
- Provider patterns
- Custom patterns
- Generic patterns 규칙 세트 만들기를 마치려면 만들기를 클릭합니다. 규칙 세트의 적용 상태가 "활성"으로 설정된 경우 규칙 세트가 즉시 적용됩니다.
For information about configuring bypass permissions and other ruleset settings, see 리포지토리에 대한 규칙 세트 만들기.
Creating a merge protection ruleset for repositories in an organization
-
GitHub의 오른쪽 위 모서리에서 프로필 사진을 클릭한 다음, Your organizations를 클릭합니다.
-
조직을 클릭하여 선택합니다.
-
조직 이름에서 설정을 클릭합니다. "설정" 탭이 표시되지 않으면 드롭다운 메뉴를 선택한 다음 설정을 클릭합니다.

-
사이드바의 "코드, 계획 및 자동화"에서 리포지토리를 클릭한 다음 규칙 집합을 클릭합니다.
-
Click New ruleset.
-
Click New branch ruleset.
-
"규칙 집합 이름" 아래에 규칙 집합의 이름을 입력합니다.
-
필요에 따라 기본 적용 상태를 변경하려면 Disabled 를 클릭하고 적용 상태를 선택합니다.
-
Under "Target repositories", choose the repositories that the ruleset will apply to. 분기 또는 태그를 대상으로 지정하려면 "대상 분기" 또는 "대상 태그" 섹션에서 대상 추가를 선택한 다음 분기 또는 태그를 포함하거나 제외할 방법을 선택합니다.
fnmatch구문을 사용하여 패턴에 따라 분기 또는 태그를 포함하거나 제외할 수 있습니다. 자세한 내용은fnmatch구문 사용을 참조하세요.
동일한 규칙 세트에 여러 대상 지정 조건을 추가할 수 있습니다. 예를 들어 기본 분기를 포함하고 *feature* 패턴과 일치하는 분기를 포함한 다음, not-a-feature 패턴과 일치하는 분기를 명시적으로 제외할 수 있습니다.
- Under "Branch protections", select Require secret scanning alerts are resolved.
- Under "Secret types", select one or more types of secrets that should block merging:
- Provider patterns
- Custom patterns
- Generic patterns 규칙 세트 만들기를 마치려면 만들기를 클릭합니다. 규칙 세트의 적용 상태가 "활성"으로 설정된 경우 규칙 세트가 즉시 적용됩니다.
For information about configuring bypass permissions and other ruleset settings, see 조직 내 리포지토리에 대한 규칙 세트 만들기.
Unblocking a pull request
When this rule blocks a pull request because of open alerts, you must resolve each alert that matches the secret types selected in the ruleset. See 비밀 검사에서 경고 해결.