From 451e92227a9e1d19dce1f9ba6c45df78316ed230 Mon Sep 17 00:00:00 2001 From: Dave Arnold Date: Fri, 4 Apr 2025 15:45:36 -0700 Subject: [PATCH] fix: enhance extra_files logic to handle null ref values --- github_files.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github_files.tf b/github_files.tf index b6cb553..fdd479e 100644 --- a/github_files.tf +++ b/github_files.tf @@ -45,10 +45,10 @@ data "github_ref" "ref" { locals { extra_files = concat( var.extra_files, - local.lookup_sha == 1 && length(data.github_ref.ref) > 0 ? [] : [ + local.lookup_sha == 1 && length(data.github_ref.ref) > 0 && data.github_ref.ref[0] != null ? [] : [ { path = ".TEMPLATE_SHA", - content = data.github_ref.ref[0].sha + content = local.lookup_sha == 1 && length(data.github_ref.ref) > 0 ? data.github_ref.ref[0].sha : "" } ] )