CI Perf Lint

terraform-lockfile-missing

What it flags

Repositories that run terraform in CI but have no .terraform.lock.hcl file committed.

Why it matters

Without a lock file, Terraform resolves provider versions at terraform init time, which means:

  1. Run terraform init locally to generate .terraform.lock.hcl
  2. Commit the lock file
  3. Add the lock file to the Terraform provider cache key
- uses: actions/cache@v4
  with:
    path: ~/.terraform.d/plugin-cache
    key: terraform-${{ runner.os }}-${{ hashFiles('**/.terraform.lock.hcl') }}

Caveats