diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index c6ef353c0..78f76a848 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -75,12 +75,13 @@ jobs: - name: Checkout uses: actions/checkout@v3.3.0 - name: "Check if image exists" + id: imageCheck run: | docker manifest inspect tractusx/${{ matrix.image }}:sha-${{ needs.git-sha7.outputs.value }} continue-on-error: true - name: Run Trivy vulnerability scanner - if: success() + if: success() && steps.imageCheck.outcome != 'failure' uses: aquasecurity/trivy-action@master with: image-ref: "tractusx/${{ matrix.image }}:sha-${{ needs.git-sha7.outputs.value }}" @@ -90,7 +91,7 @@ jobs: severity: "CRITICAL,HIGH" timeout: "10m0s" - name: Upload Trivy scan results to GitHub Security tab - if: always() + if: success() && steps.imageCheck.outcome != 'failure' uses: github/codeql-action/upload-sarif@v2 with: sarif_file: "trivy-results-${{ matrix.image }}.sarif"