1+ ---
12name : checkov
23# Controls when the workflow will run
34on :
4- # Triggers the workflow on worflow call request events.
5+ # Triggers the workflow on worflow call request events.
56 workflow_call :
67 inputs :
7- directory :
8+ directory :
89 required : true
910 type : string
10- continue_on_error :
11+ continue_on_error :
1112 required : true
1213 type : string
1314 default : ' true'
14- var_file :
15+ var_file :
1516 required : false
1617 type : string
17-
18+
1819# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1920jobs :
2021 # This workflow contains a single job called "scan"
2122 scan :
2223 permissions :
23- contents : read # for actions/checkout to fetch code
24- security-events : write # for github/codeql-action/upload-sarif to upload SARIF results
25- actions : read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
26-
24+ contents : read # for actions/checkout to fetch code
25+ security-events : write # - for github/codeql-action/upload-sarif to upload SARIF results
26+ actions : read # - only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
27+
2728 # The type of runner that the job will run on
2829 runs-on : ubuntu-latest
2930
3031 # Steps represent a sequence of tasks that will be executed as part of the job
3132 steps :
3233 # Checks-out your repository under $GITHUB_WORKSPACE, so follow-up steps can access it
3334 - uses : actions/checkout@v3
34-
35+
3536 - name : Checkov GitHub Action
3637 if : ${{ inputs.continue_on_error == 'true' }}
3738 uses : bridgecrewio/checkov-action@v12
4243 soft_fail : true
4344 directory : ${{ inputs.directory}}
4445 var_file : ${{ inputs.var_file}}
45-
46+
4647 - name : Checkov GitHub Action
4748 if : ${{ inputs.continue_on_error == 'false' }}
4849 uses : bridgecrewio/checkov-action@v12
@@ -52,15 +53,15 @@ jobs:
5253 output_file_path : console,results.sarif
5354 directory : ${{ inputs.directory}}
5455 var_file : ${{ inputs.var_file}}
55-
56-
56+
5757 - name : Upload SARIF file
5858 uses : github/codeql-action/upload-sarif@v2
5959 # Results are generated only on a success or failure
60- # this is required since GitHub by default won't run the next step
61- # when the previous one has failed. Security checks that do not pass will 'fail'.
60+ # This is required since GitHub by default won't run the next step
61+ # when the previous one has failed. Security checks that do not pass will 'fail'
6262 # An alternative is to add `continue-on-error: true` to the previous step
63- # Or 'soft_fail: true' to checkov.
63+ # Or 'soft_fail: true' to checkov
6464 if : success() || failure()
6565 with :
6666 sarif_file : results.sarif
67+ ...
0 commit comments