From f1873b03743df4874e109a1ab43fde06a5e72a84 Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Mon, 29 Jan 2024 13:51:28 +0100 Subject: [PATCH] feat: don't check bake files with terragrunt (#5178) Exclude the default docker bake files in HCL format from the list of files to lint with Terragrunt. Note that Docker bake supports defining arbitrary names for configuration files, so this commit doesn't cover the scenario that a user defined an arbitrary name for a Docker bake configuration file in HCL format. Example: example-bake-config-file.hcl will be included in the list of files to lint with Terragrunt. Ref (default bake names): https://docs.docker.com/build/bake/reference/#file-format --- lib/functions/buildFileList.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/functions/buildFileList.sh b/lib/functions/buildFileList.sh index b1f61a0d..32876c50 100755 --- a/lib/functions/buildFileList.sh +++ b/lib/functions/buildFileList.sh @@ -569,7 +569,11 @@ function BuildFileList() { ############################ # Get the Terragrunt files # ############################ - elif [ "${FILE_TYPE}" == "hcl" ] && [[ ${FILE} != *".tflint.hcl"* ]] && [[ ${FILE} != *".pkr.hcl"* ]]; then + elif [ "${FILE_TYPE}" == "hcl" ] && + [[ ${FILE} != *".tflint.hcl"* ]] && + [[ ${FILE} != *".pkr.hcl"* ]] && + [[ ${FILE} != *"docker-bake.hcl"* ]] && + [[ ${FILE} != *"docker-bake.override.hcl"* ]]; then FILE_ARRAY_TERRAGRUNT+=("${FILE}") ############################