Skip to content

Commit 251378b

Browse files
authored
Add skip_image_scan input
1 parent 029a3a0 commit 251378b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/build-docker-artifacts.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ on:
2222
type: boolean
2323
required: false
2424
default: true
25+
skip_image_scan:
26+
type: boolean
27+
required: false
28+
default: false
2529
runs_on:
2630
type: string
2731
required: false
@@ -240,7 +244,7 @@ jobs:
240244
run: docker logout ${{ steps.login-ecr.outputs.registry }}
241245

242246
- name: Scan image
243-
if: ${{ fromJson(vars.SKIP_IMAGE_SCAN) != true && matrix.component.skip_image_scan != true }}
247+
if: ${{ skip_image_scan != true && fromJson(vars.SKIP_IMAGE_SCAN) != true && matrix.component.skip_image_scan != true }}
244248
id: get-ecr-scan-result
245249
uses: ./tmp/github-workflows/.github/actions/get-ecr-scan-result
246250
with:
@@ -250,7 +254,7 @@ jobs:
250254
ecr_repository: ${{ matrix.component.ecr_repository }}
251255
image_tag: ${{ matrix.component.image_tag }}
252256
- name: Check scan results
253-
if: ${{ fromJson(vars.SKIP_IMAGE_SCAN) != true && matrix.component.skip_image_scan != true }}
257+
if: ${{ skip_image_scan != true && fromJson(vars.SKIP_IMAGE_SCAN) != true && matrix.component.skip_image_scan != true }}
254258
run: |
255259
if [ "${{ steps.get-ecr-scan-result.outputs.critical }}" != "null" ] || [ "${{ steps.get-ecr-scan-result.outputs.high }}" != "null" ]; then
256260
echo "Docker image contains vulnerabilities at critical or high level"

0 commit comments

Comments
 (0)