@@ -24,20 +24,33 @@ jobs:
2424 with :
2525 path : ~/.tflint.d/plugins
2626 key : tflint-${{ hashFiles('.tflint.hcl') }}
27- - uses : terraform-linters/setup-tflint@v5
27+ - uses : terraform-linters/setup-tflint@v6
2828 name : Setup TFLint
2929 - name : Show version
3030 run : tflint --version
3131 - name : Init TFLint
3232 run : tflint --init
3333 - name : Run TFLint
34- run : tflint --format sarif --recursive --config "$GITHUB_WORKSPACE/.tflint.hcl" > tflint-results.sarif
34+ # Run TFLint, outputting the results to a SARIF file. We use `tee` so
35+ # that we can still see the output in the logs, and capture the exit
36+ # code properly with `pipefail`.
37+ run : |
38+ set -o pipefail
39+ tflint --format sarif --recursive \
40+ --config "$GITHUB_WORKSPACE/.tflint.hcl" \
41+ | tee tflint-results.sarif
42+ exit "${PIPESTATUS[0]}"
3543 - name : Parse SARIF file for annotations
36- if : always()
37- 44+ 3845 with :
39- severity-level : low
4046 sarif-file : tflint-results.sarif
47+ annotation-level : notice
48+ # - name: Parse SARIF file for annotations
49+ # if: always()
50+ 51+ # with:
52+ # severity-level: notice
53+ # sarif-file: tflint-results.sarif
4154 # When run on main, if SARIF uploads are available, we want to upload the
4255 # SARIF file to GitHub.
4356 - name : Upload SARIF result
0 commit comments