@@ -646,53 +646,55 @@ This is due to some terraform limitation and we will update the module once terr
646646
647647 Default is ` [] ` .
648648
649- - [ ** ` branch_protections ` ** ] ( #var-branch_protections ) : * (Optional ` list(branch_protection_v3) ` )* <a name =" var-branch_protections " ></a >
650-
651- ** _ DEPRECATED_ ** To ensure compatibility with future versions of this module, please use ` branch_protections_v3 ` .
652- This argument is ignored if ` branch_protections_v3 ` is used. Please see ` branch_protections_v3 ` for supported attributes.
653-
654- Default is ` [] ` .
655-
656649#### Branch Protections v4 Configuration
657650
658- - [ ** ` branch_protections_v4 ` ** ] ( #var-branch_protections_v4 ) : * (Optional ` map (branch_protection_v4)` )* <a name =" var-branch_protections_v4 " ></a >
651+ - [ ** ` branch_protections_v4 ` ** ] ( #var-branch_protections_v4 ) : * (Optional ` list (branch_protection_v4)` )* <a name =" var-branch_protections_v4 " ></a >
659652
660- This map allows you to configure v4 branch protection for repositories in your organization.
653+ This resource allows you to configure v4 branch protection for repositories in your organization.
661654
662- Each element in the map is a branch to be protected and the value the corresponding to the desired configuration for the branch.
655+ Each element in the list is a branch to be protected and the value the corresponding to the desired configuration for the branch.
663656
664657 When applied, the branch will be protected from forced pushes and deletion.
665658 Additional constraints, such as required status checks or restrictions on users and teams, can also be configured.
666659
667- ** _ NOTE_ ** This will take precedence over v3 branch protections.
660+ ** _ NOTE:_ ** May conflict with v3 branch protections if used for the same branch.
661+
662+ Default is ` [] ` .
663+
664+ Each ` branch_protection_v4 ` object in the list accepts the following attributes:
665+
666+ - [ ** ` pattern ` ** ] ( #attr-branch_protections_v4-pattern ) : * (** Required** ` string ` )* <a name =" attr-branch_protections_v4-pattern " ></a >
667+
668+ Identifies the protection rule pattern.
668669
669- Default is ` null ` .
670+ - [ ** ` _key ` ** ] ( #attr-branch_protections_v4-_key ) : * (Optional ` string ` ) * < a name = " attr-branch_protections_v4-_key " ></ a >
670671
671- Each ` branch_protection_v4 ` object in the map accepts the following attributes:
672+ An alternative key to use in ` for_each ` resource creation.
673+ Defaults to the value of ` var.pattern ` .
672674
673675 - [ ** ` allows_deletions ` ** ] ( #attr-branch_protections_v4-allows_deletions ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-allows_deletions " ></a >
674676
675- Setting this to true to allow the branch to be deleted.
677+ Setting this to ` true ` to allow the branch to be deleted.
676678
677679 Default is ` false ` .
678680
679681 - [ ** ` allows_force_pushes ` ** ] ( #attr-branch_protections_v4-allows_force_pushes ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-allows_force_pushes " ></a >
680682
681- Setting this to true to allow force pushes on the branch.
683+ Setting this to ` true ` to allow force pushes on the branch.
682684
683685 Default is ` false ` .
684686
685687 - [ ** ` blocks_creations ` ** ] ( #attr-branch_protections_v4-blocks_creations ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-blocks_creations " ></a >
686688
687- Setting this to true will block creating the branch.
689+ Setting this to ` true ` will block creating the branch.
688690
689691 Default is ` false ` .
690692
691693 - [ ** ` enforce_admins ` ** ] ( #attr-branch_protections_v4-enforce_admins ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-enforce_admins " ></a >
692694
693- Setting this to true enforces status checks for repository administrators.
695+ Keeping this as ` true ` enforces status checks for repository administrators.
694696
695- Default is ` false ` .
697+ Default is ` true ` .
696698
697699 - [ ** ` push_restrictions ` ** ] ( #attr-branch_protections_v4-push_restrictions ) : * (Optional ` list(string) ` )* <a name =" attr-branch_protections_v4-push_restrictions " ></a >
698700
@@ -723,8 +725,6 @@ This is due to some terraform limitation and we will update the module once terr
723725
724726 Enforce restrictions for pull request reviews.
725727
726- Default is ` null ` .
727-
728728 The ` required_pull_request_reviews ` object accepts the following attributes:
729729
730730 - [ ** ` dismiss_stale_reviews ` ** ] ( #attr-branch_protections_v4-required_pull_request_reviews-dismiss_stale_reviews ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-required_pull_request_reviews-dismiss_stale_reviews " ></a >
@@ -733,26 +733,30 @@ This is due to some terraform limitation and we will update the module once terr
733733
734734 Default is ` true ` .
735735
736+ - [ ** ` restrict_dismissals ` ** ] ( #attr-branch_protections_v4-required_pull_request_reviews-restrict_dismissals ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-required_pull_request_reviews-restrict_dismissals " ></a >
737+
738+ Restrict pull request review dismissals.
739+
736740 - [ ** ` dismissal_restrictions ` ** ] ( #attr-branch_protections_v4-required_pull_request_reviews-dismissal_restrictions ) : * (Optional ` list(string) ` )* <a name =" attr-branch_protections_v4-required_pull_request_reviews-dismissal_restrictions " ></a >
737741
738742 The list of actor Names/IDs with dismissal access.
739- If not empty, restrict_dismissals is ignored.
740- Actor names must either begin with a "/" for users or the organization name followed by a "/" for teams.
743+ If not empty, ` restrict_dismissals ` is ignored
744+ Actor names must either begin with a ` / ` for users or the organization name followed by a ` / ` for teams.
741745
742746 Default is ` [] ` .
743747
744748 - [ ** ` pull_request_bypassers ` ** ] ( #attr-branch_protections_v4-required_pull_request_reviews-pull_request_bypassers ) : * (Optional ` list(string) ` )* <a name =" attr-branch_protections_v4-required_pull_request_reviews-pull_request_bypassers " ></a >
745749
746750 The list of actor Names/IDs that are allowed to bypass pull request requirements.
747- Actor names must either begin with a "/" for users or the organization name followed by a "/" for teams.
751+ Actor names must either begin with a ` / ` for users or the organization name followed by a ` / ` for teams.
748752
749753 Default is ` [] ` .
750754
751755 - [ ** ` require_code_owner_reviews ` ** ] ( #attr-branch_protections_v4-required_pull_request_reviews-require_code_owner_reviews ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-required_pull_request_reviews-require_code_owner_reviews " ></a >
752756
753757 Require an approved review in pull requests including files with a designated code owner.
754758
755- Default is ` false ` .
759+ Default is ` true ` .
756760
757761 - [ ** ` required_approving_review_count ` ** ] ( #attr-branch_protections_v4-required_pull_request_reviews-required_approving_review_count ) : * (Optional ` number ` )* <a name =" attr-branch_protections_v4-required_pull_request_reviews-required_approving_review_count " ></a >
758762
@@ -766,8 +770,6 @@ This is due to some terraform limitation and we will update the module once terr
766770 Enforce restrictions for required status checks.
767771 See Required Status Checks below for details.
768772
769- Default is ` null ` .
770-
771773 The ` required_status_checks ` object accepts the following attributes:
772774
773775 - [ ** ` strict ` ** ] ( #attr-branch_protections_v4-required_status_checks-strict ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-required_status_checks-strict " ></a >
0 commit comments