From 0d5a72077f9a7deb922c6edfa096d279363fd069 Mon Sep 17 00:00:00 2001 From: devops-mher Date: Fri, 31 Mar 2023 16:15:46 +0400 Subject: [PATCH] update module terraform --- github_branch_protection/main.tf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/github_branch_protection/main.tf b/github_branch_protection/main.tf index 22b8150..5f554a5 100644 --- a/github_branch_protection/main.tf +++ b/github_branch_protection/main.tf @@ -18,21 +18,21 @@ resource "github_branch_protection" "branch" { for_each = var.required_status_checks == null ? [] : [var.required_status_checks] content { - strict = required_status_checks.value.strict - contexts = required_status_checks.value.contexts + strict = lookup(required_status_checks.value, "strict", false) + contexts = lookup(required_status_checks.value, "contexts", []) } } dynamic "required_pull_request_reviews" { for_each = var.required_pull_request_reviews != null ? [var.required_pull_request_reviews] : [] content { - restrict_dismissals = required_pull_request_reviews.value.restrict_dismissals - pull_request_bypassers = required_pull_request_reviews.value.pull_request_bypassers - require_last_push_approval = required_pull_request_reviews.value.require_last_push_approval - dismiss_stale_reviews = required_pull_request_reviews.value.dismiss_stale_reviews - dismissal_restrictions = required_pull_request_reviews.value.dismissal_restrictions - require_code_owner_reviews = required_pull_request_reviews.value.require_code_owner_reviews - required_approving_review_count = required_pull_request_reviews.value.required_approving_review_count + restrict_dismissals = lookup(required_pull_request_reviews.value, "restrict_dismissals", false) + pull_request_bypassers = lookup(required_pull_request_reviews.value, "pull_request_bypassers", []) + require_last_push_approval = lookup(required_pull_request_reviews.value, "require_last_push_approval", false) + dismiss_stale_reviews = lookup(required_pull_request_reviews.value, "dismiss_stale_reviews", false) + dismissal_restrictions = lookup(required_pull_request_reviews.value, "dismissal_restrictions", []) + require_code_owner_reviews = lookup(required_pull_request_reviews.value, "require_code_owner_reviews", false) + required_approving_review_count = lookup(required_pull_request_reviews.value, "required_approving_review_count", 0) } }