Skip to content

Commit abba06e

Browse files
committed
Add GitHub Actions workflow for Terraform linting
1 parent 11d8517 commit abba06e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Terraform Lint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.tf'
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint:
13+
name: Terraform Format & Lint
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Set up Terraform
21+
uses: hashicorp/setup-terraform@v3
22+
with:
23+
terraform_version: 1.11.4 # or whatever version you're using
24+
25+
- name: Terraform fmt check
26+
run: terraform fmt -check -recursive
27+
28+
- name: Install TFLint
29+
run: |
30+
curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
31+
32+
- name: Run TFLint
33+
run: tflint --recursive

0 commit comments

Comments
 (0)