GitHub Action automatically validating Terraform modules.
- Docker Hub: devopsinfra/action-terraform-validate:latest
- GitHub Packages: ghcr.io/devops-infra/action-terraform-validate:latest
- Main action is using
terraform validate. - It's a stripped down image of my other creation - devops-infra/docker-terragrunt - framework for managing Infrastructure-as-a-Code.
- it's main use will be everywhere where Terraform or OpenTofu is used and is great for statically or actively checking modules' sources.
This action supports three tag levels for flexible versioning:
vX: latest patch of the major version (e.g.,v1).vX.Y: latest patch of the minor version (e.g.,v1.2).vX.Y.Z: fixed to a specific release (e.g.,v1.2.3).
- name: Validate Terraform modules
uses: devops-infra/action-terraform-validate@v1.0.2
with:
dir_filter: modules| Input | Required | Default | Description |
|---|---|---|---|
dir_filter |
No | * |
Prefixes or sub-directories to search for Terraform modules. Use comma as separator. |
Validate whole Terraform setup in repository root.
name: Validate Terraform
on:
push
jobs:
terraform-validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Validate Terraform configuration
uses: devops-infra/action-terraform-validate@v1.0.2Validate Terraform modules only in modules/aws and modules/gcp directories.
name: Validate Terraform
on:
push
jobs:
terraform-validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Validate Terraform modules
uses: devops-infra/action-terraform-validate@v1.0.2
with:
dir_filter: modules/aws,modules/gcpContributions are welcome! See CONTRIBUTING. This project is licensed under the MIT License - see the LICENSE file for details.
MIT β see LICENSE.
If you have any questions or need help, please:
- Create an issue
- Star this repository if you find it useful!