브랜치 보호는 사용자가 실수로 또는 악의적으로 잘못된 코드를 중요한 브랜치에 푸시하지 못하도록 방지합니다. 저장소 관리자는 다음 기준에 따라 특정 브랜치에 코드 제출을 차단하도록 브랜치 보호를 구성할 수 있습니다.
병합 전에 pull 요청 필요
사용 설정하면 보호된 브랜치로 병합하기 위해 구성 가능한 수의 검토자와 승인자가 pull 요청을 생성하고 승인해야 합니다.
검토자와 승인자는 IAM 역할을 사용하여 구성됩니다.
검토자
보호된 저장소에 Secure Source Manager 저장소 작성자 역할(roles/securesourcemanager.repoWriter)이 하나 이상 있어야 합니다.
승인 담당자
보호된 저장소에 저장소 관리자 역할(roles/securesourcemanager.repoAdmin) 또는 저장소 작성자 역할(roles/securesourcemanager.repoWriter)과 저장소 풀 요청 승인자 역할 (roles/securesourcemanager.repoPullRequestApprover)이 모두 있어야 합니다.
저장소 관리자 역할 또는 저장소 작성자 역할이 있고 저장소 풀 요청 승인자 역할도 있는 사용자는 풀 요청을 승인할 때 승인자와 검토자로 모두 간주됩니다.
오래된 리뷰에서 병합 차단
사용 설정하면 검토 또는 승인이 부여된 후 pull 요청에 추가된 커밋이 병합을 차단합니다. pull 요청을 보호된 브랜치에 병합하려면 새 검토와 승인이 부여되어야 합니다.
모든 브랜치 보호 규칙에서 기본적으로 사용 설정됩니다.
병합하기 전에 검토 의견을 해결해야 함
사용 설정하면 풀 요청의 모든 댓글과 변경 요청이 해결되어야 보호된 브랜치로 병합될 수 있습니다.
선형 기록 필요
사용 설정하면 병합 커밋을 도입하는 풀 요청이 차단됩니다.
선형 Git 기록을 유지하면 각 커밋의 역할을 더 쉽게 이해할 수 있는 등 여러 이점이 있습니다.
상태 확인 필요
사용 설정하면 풀 요청이 보호된 브랜치로 병합되기 전에 triggers 파일에 정의된 트리거에 대해 빌드 상태가 성공해야 합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Branch protection overview\n\nThis page describes branch protection in Secure Source Manager for\nadministrators.\n\nTo learn how to set up branch protection, follow the instructions in\n[Configure branch protection](/secure-source-manager/docs/configure-branch-protection).\n\nBranch protection prevents users from accidentally or maliciously pushing bad\ncode to an important branch. Repository administrators can configure branch\nprotection to block code submission to specific branches based on the following\ncriteria.\n\nRequire a pull request before merging\n-------------------------------------\n\nWhen enabled, a pull request must be created and approved by a configurable\nnumber of reviewers and approvers to merge into protected branches.\n\nReviewers and approvers are configured using IAM roles.\n\nReviewers\n: Must have at least the Secure Source Manager Repository Writer role\n (`roles/securesourcemanager.repoWriter`) on the protected repository.\n\nApprovers\n: Must have either the Repository Admin role\n (`roles/securesourcemanager.repoAdmin`) or both the Repository Writer role\n (`roles/securesourcemanager.repoWriter`) and the Repository Pull Request\n Approver role (`roles/securesourcemanager.repoPullRequestApprover`) on the\n protected repository.\n\nUsers with the Repository Admin role or the Repository Writer role who also have\nthe Repository Pull Request Approver role count as both an approver and reviewer\nwhen they approve a pull request.\n\n### Block merge on stale reviews\n\nWhen enabled, commits added to a pull request after a review or approval has\nbeen granted will block the merge. New reviews and approvals must be granted\nbefore the pull request can be merged into the protected branch.\n\nEnabled by default in all branch protection rules.\n\nRequire review comments to be resolved before merging\n-----------------------------------------------------\n\nWhen enabled, all comments and requests for changes on the pull request must be\nresolved before it can be merged into the protected branch.\n\nRequire linear history\n----------------------\n\nWhen enabled, pull requests that would introduce merge commits are blocked.\n\nMaintaining a linear Git history has many benefits, including making it simpler\nto understand what each commit does.\n\nRequire status checks\n---------------------\n\nWhen enabled, you can require a successful [build status](/secure-source-manager/docs/create-triggers-file#build-status) for\ntriggers defined in your [triggers](/secure-source-manager/docs/triggers-file-schema) file before a pull\nrequest can be merged into a protected branch.\n\nWhat's next\n-----------\n\n- [Configure branch protection](/secure-source-manager/docs/configure-branch-protection)\n- [Connect to Cloud Build](/secure-source-manager/docs/connect-cloud-build)"]]