4242 description : The kind of repository (github or ecr)
4343 default : " github"
4444 type : string
45+ enableContainerScan :
46+ required : false
47+ description : Apply the container scan
48+ default : true
49+ type : boolean
4550 runner :
4651 required : false
4752 description : Runner type
@@ -106,6 +111,7 @@ jobs:
106111 ${{ inputs.registryHostname }}/${{ inputs.registryOrg }}/${{ github.event.deployment.payload.name }}:${{ inputs.version }}
107112 ${{ inputs.registryHostname }}/${{ inputs.registryOrg }}/${{ github.event.deployment.payload.name }}:${{ github.sha }}
108113 - name : Scan for vulnerabilities
114+ if : inputs.enableContainerScan
109115 uses : crazy-max/ghaction-container-scan@v3
110116 with :
111117 image : ${{ inputs.registryHostname }}/${{ inputs.registryOrg }}/${{ github.event.deployment.payload.name }}:latest
@@ -166,7 +172,7 @@ jobs:
166172 APP_NAME=${{ github.event.deployment.payload.name }}
167173 ENVIRONMENT=${{ github.event.deployment.payload.env }}
168174 NPM_GITHUB_TOKEN=${{ secrets.npmGithubReadToken }}
169- cache-from : type=registry,ref=${{ inputs.registryHostname }}/${{ inputs.registryOrg }}/${{ github.event.deployment.payload.name }}
175+ cache-from : type=registry,ref=${{ inputs.registryHostname }}/${{ github.event.deployment.payload.name }}
170176 cache-to : type=inline
171177 context : ${{ github.event.deployment.payload.container.context }}
172178 load : true
@@ -177,7 +183,7 @@ jobs:
177183 ${{ steps.login-ecr.outputs.registry }}/${{ github.event.deployment.payload.name }}:${{ inputs.version }}
178184 ${{ steps.login-ecr.outputs.registry }}/${{ github.event.deployment.payload.name }}:${{ github.sha }}
179185 - name : Scan for vulnerabilities
180- if : inputs.repository_kind == 'ecr'
186+ if : inputs.enableContainerScan
181187 uses : crazy-max/ghaction-container-scan@v3
182188 with :
183189 image : ${{ steps.login-ecr.outputs.registry }}/${{ github.event.deployment.payload.name }}:latest
@@ -245,6 +251,7 @@ jobs:
245251 target : ${{ matrix.containerfile_targets }}
246252 - name : Scan for vulnerabilities
247253 uses : crazy-max/ghaction-container-scan@v3
254+ if : inputs.enableContainerScan
248255 with :
249256 image : ${{ inputs.registryHostname }}/${{ inputs.registryOrg }}/${{ github.event.deployment.payload.name }}-${{ matrix.containerfile_targets }}:latest
250257 dockerfile : Containerfile
@@ -306,7 +313,7 @@ jobs:
306313 APP_NAME=${{ github.event.deployment.payload.name }}
307314 ENVIRONMENT=${{ github.event.deployment.payload.env }}
308315 NPM_GITHUB_TOKEN=${{ secrets.npmGithubReadToken }}
309- cache-from : type=registry,ref=${{ inputs.registryHostname }}/${{ inputs.registryOrg }}/${{ github.event.deployment.payload.name }}
316+ cache-from : type=registry,ref=${{ inputs.registryHostname }}/${{ github.event.deployment.payload.name }}
310317 cache-to : type=inline
311318 context : ${{ github.event.deployment.payload.container.context }}
312319 load : true
@@ -318,6 +325,7 @@ jobs:
318325 ${{ steps.login-ecr.outputs.registry }}/${{ github.event.deployment.payload.name }}-${{ matrix.containerfile_targets }}:${{ github.sha }}
319326 target : ${{ matrix.containerfile_targets }}
320327 - name : Scan for vulnerabilities
328+ if : inputs.enableContainerScan
321329 uses : crazy-max/ghaction-container-scan@v3
322330 with :
323331 image : ${{ steps.login-ecr.outputs.registry }}/${{ github.event.deployment.payload.name }}-${{ matrix.containerfile_targets }}:latest
0 commit comments