From e44398e45c96a9a3a12a0bfeba7597ad5438c36e Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 22 Oct 2022 11:20:04 -0700 Subject: fix(ops/github): some fixes related to repositories creation --- ops/github/repositories.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ops') diff --git a/ops/github/repositories.tf b/ops/github/repositories.tf index 2465d43..15a5b1d 100644 --- a/ops/github/repositories.tf +++ b/ops/github/repositories.tf @@ -7,7 +7,7 @@ resource "github_repository" "repos" { name = try(each.value.name, each.key) visibility = each.value.visibility - archived = each.value.archived + archived = try(each.value.archived, false) description = try(each.value.description, null) has_downloads = false has_issues = try(each.value.has_issues, true) @@ -17,7 +17,7 @@ resource "github_repository" "repos" { allow_squash_merge = true allow_rebase_merge = true vulnerability_alerts = try(each.value.vulnerability_alerts, false) - delete_branch_on_merge = try(each.value.vulnerability_alerts, false) + delete_branch_on_merge = try(!each.value.archived, true) } resource "github_branch_default" "main" { @@ -26,7 +26,7 @@ resource "github_branch_default" "main" { # use the name for the repository if set for_each = { for k, v in local.repositories : try(v.name, k) => v - if v.archived == false + if try(v.archived, false) == false } repository = each.key -- cgit 1.4.1