Skip to content

feat: add reusable Terraform lint workflow (tf-lint.yml) - #50

Merged
cpitzi merged 1 commit into
mainfrom
agent/tf-lint-workflow
Aug 17, 2026
Merged

feat: add reusable Terraform lint workflow (tf-lint.yml)#50
cpitzi merged 1 commit into
mainfrom
agent/tf-lint-workflow

Conversation

@lentago-claude-runner

Copy link
Copy Markdown
Contributor

Summary

Closes #41.

Adds tf-lint.yml, a reusable workflow_call workflow that gives the five fleet repos carrying Terraform (solidago, kalmia, claytonia, drosera, .github) a consistent, centrally-maintained lint gate rather than ad-hoc per-repo scripts.

Four quality gates, each independently toggleable:

  • terraform fmt -check -recursive — formatting consistency
  • terraform init -backend=false + terraform validate — config validity; the -backend=false flag is deliberate: no remote state means no cloud credentials, so this gate is safe to run on fork PRs without secrets
  • tflint — idiomatic Terraform and provider-specific rules
  • trivy config — IaC misconfiguration scan; Trivy is chosen over Checkov for fleet consistency (it already runs in site-deploy.yml for container scanning — one tool across two surfaces, not two separate tools)

Design choices:

  • All inputs are optional with sensible defaults (backwards-compatible contract)
  • SHA-pinned third-party actions with version comments in every uses: line
  • if: github.event.pull_request.draft == false gate consistent with shellcheck.yml
  • The required-check note in the header explains the no-paths:-filter rule — same language as docs-check.yml
  • Ships at @v1.2.0 (v1.1.0 is already cut); adoption by each Terraform repo is per-repo and staged

Files changed:

  • .github/workflows/tf-lint.yml — new reusable workflow
  • README.mdtf-lint.yml section with caller example and full input table
  • CLAUDE.md — workflow inventory table updated

🤖 Generated with Claude Code

Implements the shared tf-lint.yml workflow requested in #41. Runs four
quality gates over a caller-specified Terraform directory: terraform fmt
-check -recursive, terraform init -backend=false + terraform validate
(no credentials needed — deliberate for fork PRs), tflint, and trivy
config for IaC misconfiguration scanning. Each gate is individually
toggleable. Trivy is used over checkov for fleet consistency with the
existing container scan in site-deploy.yml. Ships at v1.2.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cpitzi
cpitzi merged commit 24c6168 into main Aug 17, 2026
1 check passed
@cpitzi
cpitzi deleted the agent/tf-lint-workflow branch August 17, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reusable tf-lint workflow (fmt -check, tflint, trivy config) for the five Terraform repos

1 participant