Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(
terraform_providers_lock
): Require terraform init
(and `terra…
…form_validate` hook) run when only lockfile changed (#649) ### Description of your changes ![image](https://github.com/antonbabenko/pre-commit-terraform/assets/11096782/50022937-7360-4c3b-8919-a488730c493a) When the terraform root module contains any child module it requires `terraform init` to run to be able to successfully run the provider lock operation. Previously, `terraform init` was in `terraform_providers_lock` hook too, but moved out to be only in `terraform_validate`, because there was little sense in trying to lock anything that was code invalid. If we return `terraform init` back to `terraform_providers_lock` - major changes in providers that remove resources etc. can be successfully written to lockfile without any checks, as such checks done in `terraform_validate` ## Workaround till the release of that stuff Add `files: (\.tf|\.tfvars|\.terraform\.lock\.hcl)$` to `terraform_validate` hook call --- Co-authored-by: George L. Yermulnik <[email protected]>
- Loading branch information