From 9c2902d860ac0aa56cbe52a443db4a8a9c39375e Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Thu, 19 Mar 2026 13:59:42 -0400 Subject: [PATCH] update repository_name logic to prevent emptyString --- github_files.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/github_files.tf b/github_files.tf index 06c4da5..ff7ecd7 100644 --- a/github_files.tf +++ b/github_files.tf @@ -12,7 +12,7 @@ locals { resource "github_repository_file" "codeowners" { count = var.create_codeowners && local.should_manage_files && local.github_repo != null ? 1 : 0 - repository = local.github_repo.name + repository = local.repository_name branch = var.github_default_branch file = "CODEOWNERS" content = templatefile("${path.module}/templates/CODEOWNERS", { codeowners = local.codeowners }) @@ -58,13 +58,13 @@ locals { } ] : [] ) - repository_name = local.github_repo != null ? local.github_repo.name : var.name + repository_name = coalesce(try(local.github_repo.name, null), var.name) } resource "github_repository_file" "extra_files" { for_each = local.should_manage_files && local.github_repo != null ? tomap({ for file in local.extra_files : file.path => file }) : {} - repository = local.github_repo.name + repository = local.repository_name branch = var.files_branch == null ? var.github_default_branch : var.files_branch file = each.value.path content = each.value.content @@ -87,7 +87,7 @@ resource "github_repository_file" "extra_files" { resource "github_repository_file" "managed_extra_files" { for_each = local.should_manage_files && local.github_repo != null ? tomap({ for file in var.managed_extra_files : file.path => file }) : {} - repository = local.github_repo.name + repository = local.repository_name branch = var.files_branch == null ? var.github_default_branch : var.files_branch file = each.value.path content = each.value.content