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
This commit is contained in:
Marco Ferrari 2024-01-29 13:51:28 +01:00 committed by GitHub
parent e162b950f4
commit f1873b0374
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -569,7 +569,11 @@ function BuildFileList() {
############################ ############################
# Get the Terragrunt files # # 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}") FILE_ARRAY_TERRAGRUNT+=("${FILE}")
############################ ############################