-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (54 loc) · 1.26 KB
/
terraform.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Terraform
on:
push:
branches: [ main ]
paths:
- '**.tf'
- '**.tfpl'
pull_request:
branches: [ main ]
paths:
- '**.tf'
- '**.tfpl'
jobs:
format:
name: Run formatter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Formatter
run: terraform -chdir=terraform fmt -check -diff
validate:
name: Run validation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize
run: terraform -chdir=terraform init -upgrade -backend=false
- name: Validate
run: terraform -chdir=terraform validate
ftlint:
name: Run TFLint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
- name: Init TFLint
run: tflint --init
- name: TFLint
run: tflint --chdir terraform
tfsec:
name: Run tfsec
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: tfsec
uses: aquasecurity/[email protected]
with:
working_directory: terraform