Skip to content

Commit

Permalink
fix: Ensure the repo-level .terraform-docs.yml file is used when chec…
Browse files Browse the repository at this point in the history
…king the docs
  • Loading branch information
robcoward committed Jul 26, 2024
1 parent 3751c9b commit 09a7928
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ info "Running module tests for ${TF_MODULE_PATH}"

TERRAFORM_DOCS_CONFIG_OPTS=""
if [[ -f .terraform-docs.yml ]]; then
info "Found .terraform-docs.yml file, using it for terraform-docs configuration"
info "Found repo .terraform-docs.yml file, using it for terraform-docs configuration"
TERRAFORM_DOCS_CONFIG_OPTS="--config $(pwd)/.terraform-docs.yml"
fi

cd ${TF_MODULE_PATH}

if [[ -f .terraform-docs.yml ]]; then
info "Found module .terraform-docs.yml file, using it for terraform-docs configuration"
TERRAFORM_DOCS_CONFIG_OPTS="--config $(pwd)/.terraform-docs.yml"
fi

terraform init

if [[ "${RUN_FMT}" == "true" ]]; then
Expand Down

0 comments on commit 09a7928

Please sign in to comment.