40 lines
777 B
YAML
Executable File
40 lines
777 B
YAML
Executable File
name: Terraform Validate
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "terraform/**"
|
|
- ".github/workflows/terraform-validate.yml"
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "terraform/**"
|
|
- ".github/workflows/terraform-validate.yml"
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: terraform/envs/demo
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Terraform
|
|
uses: hashicorp/setup-terraform@v3
|
|
with:
|
|
terraform_version: "1.8.5"
|
|
|
|
- name: Terraform fmt
|
|
run: terraform fmt -recursive -check
|
|
|
|
- name: Terraform init
|
|
run: terraform init -backend=false
|
|
|
|
- name: Terraform validate
|
|
run: terraform validate
|
|
|