Skip to content

Commit

Permalink
Disable Trivy by default
Browse files Browse the repository at this point in the history
Adds an input flag `enableSecurityScan` that is false by default and will only include the scan job if set to true.
  • Loading branch information
corneil authored Nov 14, 2024
1 parent d7ff312 commit 4405e22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,3 @@ jobs:
timeout-minutes: 75
run: |
./mvnw -B -s .github/settings.xml -Pdocs clean install
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'table'
severity: 'CRITICAL,HIGH'
- name: 'Scanned'
shell: bash
run: echo "::info ::Scanned"
done:
runs-on: ubuntu-latest
needs: [ scan, build ]
steps:
- name: 'Done'
shell: bash
run: echo "::info ::Done"
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: CI

on:
workflow_dispatch:
inputs:
enableSecurityScan:
type: boolean
default: false
description: 'Enable security scan with Trivy'
push:
branches:
- '2.11.x'
Expand Down Expand Up @@ -188,6 +193,7 @@ jobs:
GCR_JSON_KEY: ${{ secrets.GCR_JSON_KEY }}
scan:
runs-on: ubuntu-latest
if: ${{ inputs.enableSecurityScan != null && inputs.enableSecurityScan }}
steps:
- uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in repo mode
Expand Down

0 comments on commit 4405e22

Please sign in to comment.