From 8cf2a04e41eae9f34a3c2b4e051933ab3a2c8eaf Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Mon, 14 Nov 2022 12:09:32 +0100 Subject: [PATCH] ci(actions): skip security checks Signed-off-by: rjshrjndrn --- .github/workflows/workers.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workers.yaml b/.github/workflows/workers.yaml index ccc49be17..dd1bcc1e8 100644 --- a/.github/workflows/workers.yaml +++ b/.github/workflows/workers.yaml @@ -7,6 +7,10 @@ on: description: 'Name of a single service to build(in small letters). "all" to build everything' required: false default: 'false' + skip_security_checks: + description: 'Skip Security checks if there is a unfixable vuln or error. Value: true/false' + required: false + default: 'false' push: branches: - dev @@ -61,6 +65,7 @@ jobs: # set -x touch /tmp/images_to_build.txt + skip_security_checks=${{ github.event.inputs.skip_security_checks }} tmp_param=${{ github.event.inputs.build_service }} build_param=${tmp_param:-'false'} case ${build_param} in @@ -90,8 +95,12 @@ jobs: do echo "Bulding $image" PUSH_IMAGE=0 bash -x ./build.sh skip $image - curl -L https://github.com/aquasecurity/trivy/releases/download/v0.34.0/trivy_0.34.0_Linux-64bit.tar.gz | tar -xzf - -C ./ - ./trivy image --exit-code 1 --vuln-type os,library --severity "HIGH,CRITICAL" --ignore-unfixed $DOCKER_REPO/$image:$IMAGE_TAG + [[ "x$skip_security_checks" == "xtrue" ]] || { + curl -L https://github.com/aquasecurity/trivy/releases/download/v0.34.0/trivy_0.34.0_Linux-64bit.tar.gz | tar -xzf - -C ./ + ./trivy image --exit-code 1 --vuln-type os,library --severity "HIGH,CRITICAL" --ignore-unfixed $DOCKER_REPO/$image:$IMAGE_TAG + } && { + echo "Skipping Security Checks" + } PUSH_IMAGE=1 bash -x ./build.sh skip $image echo "::set-output name=image::$DOCKER_REPO/$image:$IMAGE_TAG" done