-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 981 Bytes
/
run-linting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Run linting
on:
- push
jobs:
lint:
runs-on: ubuntu-latest
name: Run linting
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
- name: Cache plugin dir
uses: actions/cache@v3
with:
path: ~/.tflint.d/plugins
key: tflint-${{ hashFiles('.tflint.hcl') }}
- name: Run init
run: |
tflint --init
terraform init -upgrade
- name: Show version
run: |
terraform --version
tflint --version
- name: Run linting
run: |
terraform fmt --recursive
tflint -f compact --module
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Run linting