Skip to content

Commit

Permalink
fix: enhance extra_files logic to handle null ref values
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Arnold committed Apr 4, 2025
1 parent 50f6a2f commit 451e922
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions github_files.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 : ""
}
]
)
Expand Down

0 comments on commit 451e922

Please sign in to comment.