File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 9
9
- checkout
10
10
- run :
11
11
name : Validate tf files (terraform validate)
12
- command : find . -type f -name "*.tf" -exec dirname {} \;|sort -u | while read m; do (terraform validate -check-variables=false "$m" && echo "√ $m") || exit 1 ; done
12
+ command : |
13
+ find . -type f -name "*.tf" -exec dirname {} \;|sort -u | while read m; do (terraform validate -check-variables=false "$m" && echo "√ $m") || exit 1 ; done
13
14
- run :
14
15
name : check if all tf files are formatted (terraform fmt)
15
- command : if [ `terraform fmt | wc -c` -ne 0 ]; then echo "Some terraform files need be formatted, run 'terraform fmt' to fix"; exit 1; fi
16
+ command : |
17
+ if [ `terraform fmt --list=true -diff=true -write=false | tee format-issues | wc -c` -ne 0 ]; then
18
+ echo "Some terraform files need be formatted, run 'terraform fmt' to fix"
19
+ echo "Formatting issues:"
20
+ cat format-issues
21
+ exit 1
22
+ fi
16
23
- run :
17
24
name : " Install: tflint"
18
25
command : |
24
31
install tflint /usr/local/tflint/bin
25
32
- run :
26
33
name : " tflint check"
27
- command : /usr/local/tflint/bin/tflint
34
+ command : |
35
+ terraform init
36
+ /usr/local/tflint/bin/tflint
28
37
29
38
workflows :
30
39
version : 2
You can’t perform that action at this time.
0 commit comments