diff --git a/CHANGELOG.md b/CHANGELOG.md index d27cd10..1aa33aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,3 +73,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - how sync handles pending invitations (now it does not ignore them) - removed references to other resources from for_each expressions - downgraded terraform to 1.2.9 to fix an import bug affecting for_each expressions +- refactored pages build_type assignment to trim whitespace diff --git a/terraform/locals.tf b/terraform/locals.tf index fbf0079..c05d3aa 100644 --- a/terraform/locals.tf +++ b/terraform/locals.tf @@ -122,7 +122,13 @@ locals { for file, config in lookup(config, "files", {}) : merge(config, { repository = repository file = file - content = try(file("${path.module}/../files/${config.content}"), config.content) + content = ( + try(fileexists("${path.module}/../files/${config.content}"), false) && + try(startswith( + abspath("${path.module}/../files/${config.content}"), + "${abspath("${path.module}/../files")}/" + ), false) + ) ? file("${path.module}/../files/${config.content}") : config.content }) ] ]) : lower("${item.repository}/${item.file}") => item