diff --git a/main.tf b/main.tf index 587e1bb..312430a 100644 --- a/main.tf +++ b/main.tf @@ -202,9 +202,8 @@ resource "github_branch_protection" "branch_protection" { allows_deletions = try(var.branch_protections_v4[each.value].allows_deletions, false) allows_force_pushes = try(var.branch_protections_v4[each.value].allows_force_pushes, false) - blocks_creations = try(var.branch_protections_v4[each.value].blocks_creations, false) enforce_admins = try(var.branch_protections_v4[each.value].enforce_admins, true) - push_restrictions = try(var.branch_protections_v4[each.value].push_restrictions, []) +# push_restrictions = try(var.branch_protections_v4[each.value].push_restrictions, []) this is now renamed to push allowances require_conversation_resolution = try(var.branch_protections_v4[each.value].require_conversation_resolution, false) require_signed_commits = try(var.branch_protections_v4[each.value].require_signed_commits, false) required_linear_history = try(var.branch_protections_v4[each.value].required_linear_history, false) @@ -230,6 +229,14 @@ resource "github_branch_protection" "branch_protection" { contexts = try(required_status_checks.value.contexts, []) } } + + dynamic "restrict_pushes" { + for_each = try([each.value], {}) + content { + blocks_creations = try(restrict_pushes.blocks_creations, false) + push_allowances = try(restrict_pushes.push_restrictions, []) + } + } } # --------------------------------------------------------------------------------------------------------------------- diff --git a/versions.tf b/versions.tf index 01e52ac..2af6b45 100644 --- a/versions.tf +++ b/versions.tf @@ -9,7 +9,8 @@ terraform { required_providers { github = { source = "integrations/github" - version = ">= 4.20, < 6.0" +# version = ">= 4.20, < 6.0" + version = "6.5.0" } } }