@@ -646,53 +646,55 @@ This is due to some terraform limitation and we will update the module once terr
646
646
647
647
Default is ` [] ` .
648
648
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
-
656
649
#### Branch Protections v4 Configuration
657
650
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 >
659
652
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.
661
654
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.
663
656
664
657
When applied, the branch will be protected from forced pushes and deletion.
665
658
Additional constraints, such as required status checks or restrictions on users and teams, can also be configured.
666
659
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.
668
669
669
- Default is ` null ` .
670
+ - [ ** ` _key ` ** ] ( #attr-branch_protections_v4-_key ) : * (Optional ` string ` ) * < a name = " attr-branch_protections_v4-_key " ></ a >
670
671
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 ` .
672
674
673
675
- [ ** ` allows_deletions ` ** ] ( #attr-branch_protections_v4-allows_deletions ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-allows_deletions " ></a >
674
676
675
- Setting this to true to allow the branch to be deleted.
677
+ Setting this to ` true ` to allow the branch to be deleted.
676
678
677
679
Default is ` false ` .
678
680
679
681
- [ ** ` allows_force_pushes ` ** ] ( #attr-branch_protections_v4-allows_force_pushes ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-allows_force_pushes " ></a >
680
682
681
- Setting this to true to allow force pushes on the branch.
683
+ Setting this to ` true ` to allow force pushes on the branch.
682
684
683
685
Default is ` false ` .
684
686
685
687
- [ ** ` blocks_creations ` ** ] ( #attr-branch_protections_v4-blocks_creations ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-blocks_creations " ></a >
686
688
687
- Setting this to true will block creating the branch.
689
+ Setting this to ` true ` will block creating the branch.
688
690
689
691
Default is ` false ` .
690
692
691
693
- [ ** ` enforce_admins ` ** ] ( #attr-branch_protections_v4-enforce_admins ) : * (Optional ` bool ` )* <a name =" attr-branch_protections_v4-enforce_admins " ></a >
692
694
693
- Setting this to true enforces status checks for repository administrators.
695
+ Keeping this as ` true ` enforces status checks for repository administrators.
694
696
695
- Default is ` false ` .
697
+ Default is ` true ` .
696
698
697
699
- [ ** ` push_restrictions ` ** ] ( #attr-branch_protections_v4-push_restrictions ) : * (Optional ` list(string) ` )* <a name =" attr-branch_protections_v4-push_restrictions " ></a >
698
700
@@ -723,8 +725,6 @@ This is due to some terraform limitation and we will update the module once terr
723
725
724
726
Enforce restrictions for pull request reviews.
725
727
726
- Default is ` null ` .
727
-
728
728
The ` required_pull_request_reviews ` object accepts the following attributes:
729
729
730
730
- [ ** ` 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
733
733
734
734
Default is ` true ` .
735
735
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
+
736
740
- [ ** ` 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 >
737
741
738
742
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.
741
745
742
746
Default is ` [] ` .
743
747
744
748
- [ ** ` 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 >
745
749
746
750
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.
748
752
749
753
Default is ` [] ` .
750
754
751
755
- [ ** ` 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 >
752
756
753
757
Require an approved review in pull requests including files with a designated code owner.
754
758
755
- Default is ` false ` .
759
+ Default is ` true ` .
756
760
757
761
- [ ** ` 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 >
758
762
@@ -766,8 +770,6 @@ This is due to some terraform limitation and we will update the module once terr
766
770
Enforce restrictions for required status checks.
767
771
See Required Status Checks below for details.
768
772
769
- Default is ` null ` .
770
-
771
773
The ` required_status_checks ` object accepts the following attributes:
772
774
773
775
- [ ** ` 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