diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b9badce9..29b31560 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -118,14 +118,23 @@ jobs: - name: Run Trivy in GitHub SBOM mode and submit results to Dependency Graph uses: aquasecurity/trivy-action@master + if: ${{ github.event_name != 'pull_request' }} with: image-ref: 'ghcr.io/huggingface/text-generation-inference:sha-${{ env.GITHUB_SHA_SHORT }}' format: 'github' output: 'dependency-results.sbom.json' github-pat: ${{ secrets.GITHUB_TOKEN }} - + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + if: ${{ github.event_name != 'pull_request' }} + with: + image-ref: 'ghcr.io/huggingface/text-generation-inference:sha-${{ env.GITHUB_SHA_SHORT }}' + format: 'sarif' + output: 'trivy-results.sarif' + severity: 'CRITICAL' - name: Upload Trivy scan results to GitHub Security tab uses: github/codeql-action/upload-sarif@v2 + if: ${{ github.event_name != 'pull_request' }} with: sarif_file: 'trivy-results.sarif'