@@ -37,6 +37,8 @@ locals {
37
37
issue_labels_merge_with_github_labels = local. gh_labels
38
38
# Per default, GitHub activates vulnerability alerts for public repositories and disables it for private repositories
39
39
vulnerability_alerts = var. vulnerability_alerts != null ? var. vulnerability_alerts : local. private ? false : true
40
+
41
+ web_commit_signoff_required = var. web_commit_signoff_required == null ? lookup (var. defaults , " web_commit_signoff_required" , false ) : var. web_commit_signoff_required
40
42
}
41
43
42
44
locals {
@@ -112,6 +114,8 @@ resource "github_repository" "repository" {
112
114
archive_on_destroy = var. archive_on_destroy
113
115
vulnerability_alerts = local. vulnerability_alerts
114
116
117
+ web_commit_signoff_required = local. web_commit_signoff_required
118
+
115
119
dynamic "template" {
116
120
for_each = local. template
117
121
@@ -125,11 +129,17 @@ resource "github_repository" "repository" {
125
129
for_each = var. pages != null ? [true ] : []
126
130
127
131
content {
128
- source {
129
- branch = var. pages . branch
130
- path = try (var. pages . path , " /" )
132
+ dynamic "source" {
133
+ for_each = try (var. pages . build_type , null ) == " workflow" ? [] : [true ]
134
+
135
+ content {
136
+ branch = var. pages . branch
137
+ path = try (var. pages . path , " /" )
138
+ }
131
139
}
132
- cname = try (var. pages . cname , null )
140
+
141
+ build_type = try (var. pages . build_type , null )
142
+ cname = try (var. pages . cname , null )
133
143
}
134
144
}
135
145
@@ -202,9 +212,7 @@ resource "github_branch_protection" "branch_protection" {
202
212
203
213
allows_deletions = try (var. branch_protections_v4 [each . value ]. allows_deletions , false )
204
214
allows_force_pushes = try (var. branch_protections_v4 [each . value ]. allows_force_pushes , false )
205
- blocks_creations = try (var. branch_protections_v4 [each . value ]. blocks_creations , false )
206
215
enforce_admins = try (var. branch_protections_v4 [each . value ]. enforce_admins , true )
207
- push_restrictions = try (var. branch_protections_v4 [each . value ]. push_restrictions , [])
208
216
require_conversation_resolution = try (var. branch_protections_v4 [each . value ]. require_conversation_resolution , false )
209
217
require_signed_commits = try (var. branch_protections_v4 [each . value ]. require_signed_commits , false )
210
218
required_linear_history = try (var. branch_protections_v4 [each . value ]. required_linear_history , false )
@@ -219,6 +227,7 @@ resource "github_branch_protection" "branch_protection" {
219
227
pull_request_bypassers = try (required_pull_request_reviews. value . pull_request_bypassers , [])
220
228
require_code_owner_reviews = try (required_pull_request_reviews. value . require_code_owner_reviews , true )
221
229
required_approving_review_count = try (required_pull_request_reviews. value . required_approving_review_count , 0 )
230
+ require_last_push_approval = try (required_pull_request_reviews. value . require_last_push_approval , true )
222
231
}
223
232
}
224
233
0 commit comments