Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: antonbabenko/pre-commit-terraform
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.88.2
Choose a base ref
...
head repository: antonbabenko/pre-commit-terraform
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.88.3
Choose a head ref
  • 3 commits
  • 3 files changed
  • 3 contributors

Commits on Mar 14, 2024

  1. docs: Clarify deps (#647)

    ---------
    
    Co-authored-by: George L. Yermulnik <yz@yz.kiev.ua>
    MaxymVlasov and yermulnik authored Mar 14, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    495357e View commit details

Commits on Mar 22, 2024

  1. 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 <yz@yz.kiev.ua>
    MaxymVlasov and yermulnik authored Mar 22, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    02c1935 View commit details
  2. chore(release): version 1.88.3 [skip ci]

    ## [1.88.3](v1.88.2...v1.88.3) (2024-03-22)
    
    ### Bug Fixes
    
    * **`terraform_providers_lock`:** Require `terraform init` (and `terraform_validate` hook) run when only lockfile changed ([#649](#649)) ([02c1935](02c1935))
    semantic-release-bot committed Mar 22, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1bdc82b View commit details
Showing with 9 additions and 2 deletions.
  1. +1 −1 .pre-commit-hooks.yaml
  2. +7 −0 CHANGELOG.md
  3. +1 −1 README.md
2 changes: 1 addition & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@
require_serial: true
entry: hooks/terraform_validate.sh
language: script
files: (\.tf|\.tfvars)$
files: \.(tf(vars)?|terraform\.lock\.hcl)$
exclude: \.terraform/.*$

- id: terraform_providers_lock
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file.

## [1.88.3](https://github.com/antonbabenko/pre-commit-terraform/compare/v1.88.2...v1.88.3) (2024-03-22)


### Bug Fixes

* **`terraform_providers_lock`:** Require `terraform init` (and `terraform_validate` hook) run when only lockfile changed ([#649](https://github.com/antonbabenko/pre-commit-terraform/issues/649)) ([02c1935](https://github.com/antonbabenko/pre-commit-terraform/commit/02c1935a12c889a029bc0a571410f19eb39bbab1))

## [1.88.2](https://github.com/antonbabenko/pre-commit-terraform/compare/v1.88.1...v1.88.2) (2024-03-13)


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ If you are using `pre-commit-terraform` already or want to support its developme
* [`pre-commit`](https://pre-commit.com/#install),
<sub><sup>[`terraform`](https://www.terraform.io/downloads.html),
<sub><sup>[`git`](https://git-scm.com/downloads),
<sub><sup>POSIX compatible shell,
<sub><sup>[BASH `3.2.57` or newer](https://www.gnu.org/software/bash/#download),
<sub><sup>Internet connection (on first run),
<sub><sup>x86_64 or arm64 compatible operation system,
<sub><sup>Some hardware where this OS will run,