Skip to content

Commit

Permalink
fix: use -chdir in terraform_validate wrapper
Browse files Browse the repository at this point in the history
- Use Terraform's `-chdir` option rather than `cd`
  • Loading branch information
wyardley committed Sep 25, 2024
1 parent 24d30aa commit 53da8da
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@
# files to validate. This directory is assumed to be a root module.

set -eu
curdir=$(pwd)
cd "${1}"
flock -x /workspace/.terraform.lock -c "terraform init -backend=false >/dev/null"
flock -s /workspace/.terraform.lock -c "terraform validate"
cd "$curdir"
flock -x /workspace/.terraform.lock -c "terraform init -compact-warnings -chdir=$1 -backend=false >/dev/null"
flock -s /workspace/.terraform.lock -c "terraform -chdir=$1 validate"

0 comments on commit 53da8da

Please sign in to comment.