19
19
required : false
20
20
checkov_output_quiet :
21
21
description : Checkov output to display only failures
22
- type : string
22
+ type : boolean
23
23
default : true
24
24
required : false
25
25
checkov_download_external_modules :
@@ -90,41 +90,41 @@ jobs:
90
90
- ${{ inputs.runner_label }}
91
91
steps :
92
92
- name : Checkout
93
- uses : actions/checkout@v3
93
+ uses : actions/checkout@v4
94
94
with :
95
95
fetch-depth : 1
96
96
submodules : ${{ inputs.enable_submodules }}
97
97
98
- - uses : actions/setup-python@v4
98
+ - uses : actions/setup-python@v5
99
99
with :
100
100
python-version : ' 3.11'
101
101
102
102
- run : mkdir -p "${TF_PLUGIN_CACHE_DIR}"
103
103
- name : Cache Terraform
104
- uses : actions/cache@v3
104
+ uses : actions/cache@v4
105
105
with :
106
106
path : ${{ env.TF_PLUGIN_CACHE_DIR }}
107
107
key : ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }}
108
108
- name : Cache TFLint plugin dir
109
- uses : actions/cache@v3
109
+ uses : actions/cache@v4
110
110
with :
111
111
path : ~/.tflint.d/plugins
112
112
key : ${{ runner.os }}-tflint-${{ hashFiles('**/.tflint.hcl') }}
113
113
114
114
- name : Setup Node only for self-hosted runners
115
- uses : actions/setup-node@v3
115
+ uses : actions/setup-node@v4
116
116
if : ${{ inputs.default_runner_override_label == 'self-hosted' }}
117
117
with :
118
118
node-version : 18
119
119
120
120
- name : Setup Terraform
121
- uses : hashicorp/setup-terraform@v2
121
+ uses : hashicorp/setup-terraform@v3
122
122
with :
123
123
terraform_version : latest
124
124
cli_config_credentials_token : ${{ secrets.TFE_TOKEN }}
125
125
126
126
- name : Setup Helm
127
- uses : azure/setup-helm@v3
127
+ uses : azure/setup-helm@v4
128
128
with :
129
129
version : ' latest'
130
130
token : ${{ secrets.GITHUB_TOKEN }}
@@ -172,7 +172,7 @@ jobs:
172
172
- name : precommit run tflint hooks
173
173
id : precommit_run_hooks_all
174
174
if : inputs.pre_commit_run_all
175
- uses : pre-commit/action@v3.0.0
175
+ uses : pre-commit/action@v3.0.1
176
176
env :
177
177
SKIP : ${{ steps.precommit_skips.outputs.skips }}
178
178
with :
@@ -188,48 +188,47 @@ jobs:
188
188
- ${{ inputs.runner_label }}
189
189
steps :
190
190
- name : Checkout
191
- uses : actions/checkout@v3
191
+ uses : actions/checkout@v4
192
192
with :
193
193
fetch-depth : 1
194
194
submodules : ${{ inputs.enable_submodules }}
195
195
196
- - uses : actions/setup-python@v4
196
+ - uses : actions/setup-python@v5
197
197
with :
198
198
python-version : ' 3.11'
199
199
200
200
- run : mkdir -p "${TF_PLUGIN_CACHE_DIR}"
201
201
- name : Cache Terraform
202
- uses : actions/cache@v3
202
+ uses : actions/cache@v4
203
203
with :
204
204
path : ${{ env.TF_PLUGIN_CACHE_DIR }}
205
205
key : ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }}
206
206
207
207
- name : Setup Terraform
208
- uses : hashicorp/setup-terraform@v2
208
+ uses : hashicorp/setup-terraform@v3
209
209
with :
210
210
terraform_version : latest
211
211
cli_config_credentials_token : ${{ secrets.TFE_TOKEN }}
212
212
213
213
- name : Setup Helm
214
- uses : azure/setup-helm@v3
214
+ uses : azure/setup-helm@v4
215
215
with :
216
216
version : ' latest'
217
- token : ${{ secrets.GITHUB_TOKEN }}
218
217
219
218
- name : Cache TFlint
220
- uses : actions/cache@v3
219
+ uses : actions/cache@v4
221
220
with :
222
221
path : /home/runner/.tflint.d/plugins
223
222
key : ${{ runner.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
224
223
225
224
- name : Setup TFLint
226
- uses : terraform-linters/setup-tflint@v2
225
+ uses : terraform-linters/setup-tflint@v4
227
226
with :
228
- tflint_version : " v0.47.0 "
227
+ tflint_version : " v0.50.3 "
229
228
github_token : ${{ secrets.GITHUB_TOKEN }}
230
229
231
230
- name : Setup Node only for self-hosted runners
232
- uses : actions/setup-node@v3
231
+ uses : actions/setup-node@v4
233
232
if : ${{ inputs.default_runner_override_label == 'self-hosted' }}
234
233
with :
235
234
node-version : 19
@@ -241,7 +240,7 @@ jobs:
241
240
run : echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV"
242
241
243
242
- name : Cache Pre-commit
244
- uses : actions/cache@v3
243
+ uses : actions/cache@v4
245
244
with :
246
245
path : ~/.cache/pre-commit
247
246
key : pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
@@ -288,7 +287,7 @@ jobs:
288
287
- name : precommit run tflint hooks
289
288
id : precommit_run_hooks_all
290
289
if : inputs.pre_commit_run_all
291
- uses : pre-commit/action@v3.0.0
290
+ uses : pre-commit/action@v3.0.1
292
291
continue-on-error : true
293
292
env :
294
293
SKIP : ${{ steps.precommit_skips.outputs.skips }}
@@ -317,13 +316,13 @@ jobs:
317
316
- ${{ inputs.runner_label }}
318
317
steps :
319
318
- name : Checkout
320
- uses : actions/checkout@v3
319
+ uses : actions/checkout@v4
321
320
with :
322
321
fetch-depth : 1
323
322
submodules : ${{ inputs.enable_submodules }}
324
323
325
324
- name : Run Trivy vulnerability scanner in IaC mode
326
- uses : aquasecurity/trivy-action@0.12 .0
325
+ uses : aquasecurity/trivy-action@0.19 .0
327
326
with :
328
327
scan-type : ' config'
329
328
hide-progress : false
@@ -340,18 +339,29 @@ jobs:
340
339
sed -i 's#git::https:/##g' trivy-results.sarif
341
340
342
341
- name : Upload Trivy scan results to GitHub Security tab
343
- uses : github/codeql-action/upload-sarif@v2
342
+ uses : github/codeql-action/upload-sarif@v3
344
343
with :
345
344
sarif_file : ' trivy-results.sarif'
346
345
# if: inputs.upload_sarif == true
347
346
347
+ - name : Get changed files
348
+ id : changed-files
349
+ uses : tj-actions/changed-files@v44
350
+
348
351
- name : Run Checkov action
349
352
id : checkov
350
353
uses : bridgecrewio/checkov-action@master
351
354
with :
352
355
output_format : sarif
353
356
quiet : ${{ inputs.checkov_output_quiet }}
357
+ file : ${{ steps.changed-files.outputs.all_changed_files }}
354
358
skip_check : ${{ inputs.checkov_skip_check }}
355
359
download_external_modules : ${{ inputs.checkov_download_external_modules }}
356
360
skip_path : ${{inputs.checkov_skip_path}}
357
361
skip_framework : ${{inputs.checkov_skip_framework}}
362
+
363
+ - name : Upload Checkov scan results to GitHub Security tab
364
+ if : inputs.upload_sarif == true
365
+ uses : github/codeql-action/upload-sarif@v3
366
+ with :
367
+ sarif_file : ' results.sarif'
0 commit comments