From cb000f570c127a503535fa5be9c0237823ea7e4d Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 20 Sep 2025 19:24:57 +0800 Subject: [PATCH] ci: integrate Trivy vulnerability scanning into CI workflow (#4359) - Add a GitHub Actions job for vulnerability scanning using Trivy - Configure Trivy to scan the repository for vulnerabilities of severity critical, high, and medium - Ensure the workflow fails if vulnerabilities are found Signed-off-by: appleboy --- .github/workflows/gin.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/gin.yml b/.github/workflows/gin.yml index e049048c..17b54ab3 100644 --- a/.github/workflows/gin.yml +++ b/.github/workflows/gin.yml @@ -81,3 +81,19 @@ jobs: uses: codecov/codecov-action@v4 with: flags: ${{ matrix.os }},go-${{ matrix.go }},${{ matrix.test-tags }} + + vulnerability-scanning: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Run Trivy vulnerability scanner in repo mode + uses: aquasecurity/trivy-action@0.33.1 + with: + scan-type: 'fs' + ignore-unfixed: true + format: 'table' + exit-code: '1' + severity: 'CRITICAL,HIGH,MEDIUM'