@@ -42,6 +42,8 @@ locals {
4242 issue_labels_merge_with_github_labels = local. gh_labels
4343 # Per default, GitHub activates vulnerability alerts for public repositories and disables it for private repositories
4444 vulnerability_alerts = var. vulnerability_alerts != null ? var. vulnerability_alerts : local. private ? false : true
45+
46+ web_commit_signoff_required = var. web_commit_signoff_required == null ? lookup (var. defaults , " web_commit_signoff_required" , false ) : var. web_commit_signoff_required
4547}
4648
4749locals {
@@ -117,6 +119,8 @@ resource "github_repository" "repository" {
117119 archive_on_destroy = var. archive_on_destroy
118120 vulnerability_alerts = local. vulnerability_alerts
119121
122+ web_commit_signoff_required = local. web_commit_signoff_required
123+
120124 squash_merge_commit_title = local. squash_merge_commit_title
121125 squash_merge_commit_message = local. squash_merge_commit_message
122126 merge_commit_title = local. merge_commit_title
@@ -135,11 +139,17 @@ resource "github_repository" "repository" {
135139 for_each = var. pages != null ? [true ] : []
136140
137141 content {
138- source {
139- branch = var. pages . branch
140- path = try (var. pages . path , " /" )
142+ dynamic "source" {
143+ for_each = try (var. pages . build_type , null ) == " workflow" ? [] : [true ]
144+
145+ content {
146+ branch = var. pages . branch
147+ path = try (var. pages . path , " /" )
148+ }
141149 }
142- cname = try (var. pages . cname , null )
150+
151+ build_type = try (var. pages . build_type , null )
152+ cname = try (var. pages . cname , null )
143153 }
144154 }
145155
@@ -212,9 +222,7 @@ resource "github_branch_protection" "branch_protection" {
212222
213223 allows_deletions = try (var. branch_protections_v4 [each . value ]. allows_deletions , false )
214224 allows_force_pushes = try (var. branch_protections_v4 [each . value ]. allows_force_pushes , false )
215- blocks_creations = try (var. branch_protections_v4 [each . value ]. blocks_creations , false )
216225 enforce_admins = try (var. branch_protections_v4 [each . value ]. enforce_admins , true )
217- push_restrictions = try (var. branch_protections_v4 [each . value ]. push_restrictions , [])
218226 require_conversation_resolution = try (var. branch_protections_v4 [each . value ]. require_conversation_resolution , false )
219227 require_signed_commits = try (var. branch_protections_v4 [each . value ]. require_signed_commits , false )
220228 required_linear_history = try (var. branch_protections_v4 [each . value ]. required_linear_history , false )
@@ -229,6 +237,7 @@ resource "github_branch_protection" "branch_protection" {
229237 pull_request_bypassers = try (required_pull_request_reviews. value . pull_request_bypassers , [])
230238 require_code_owner_reviews = try (required_pull_request_reviews. value . require_code_owner_reviews , true )
231239 required_approving_review_count = try (required_pull_request_reviews. value . required_approving_review_count , 0 )
240+ require_last_push_approval = try (required_pull_request_reviews. value . require_last_push_approval , true )
232241 }
233242 }
234243
0 commit comments