Skip to content

Commit 4405e22

Browse files
author
Corneil du Plessis
authored
Disable Trivy by default
Adds an input flag `enableSecurityScan` that is false by default and will only include the scan job if set to true.
1 parent d7ff312 commit 4405e22

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

.github/workflows/ci-pr.yml

-21
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,3 @@ jobs:
1717
timeout-minutes: 75
1818
run: |
1919
./mvnw -B -s .github/settings.xml -Pdocs clean install
20-
scan:
21-
runs-on: ubuntu-latest
22-
steps:
23-
- uses: actions/checkout@v4
24-
- name: Run Trivy vulnerability scanner in repo mode
25-
uses: aquasecurity/trivy-action@master
26-
with:
27-
scan-type: 'fs'
28-
ignore-unfixed: true
29-
format: 'table'
30-
severity: 'CRITICAL,HIGH'
31-
- name: 'Scanned'
32-
shell: bash
33-
run: echo "::info ::Scanned"
34-
done:
35-
runs-on: ubuntu-latest
36-
needs: [ scan, build ]
37-
steps:
38-
- name: 'Done'
39-
shell: bash
40-
run: echo "::info ::Done"

.github/workflows/ci.yml

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: CI
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
enableSecurityScan:
7+
type: boolean
8+
default: false
9+
description: 'Enable security scan with Trivy'
510
push:
611
branches:
712
- '2.11.x'
@@ -188,6 +193,7 @@ jobs:
188193
GCR_JSON_KEY: ${{ secrets.GCR_JSON_KEY }}
189194
scan:
190195
runs-on: ubuntu-latest
196+
if: ${{ inputs.enableSecurityScan != null && inputs.enableSecurityScan }}
191197
steps:
192198
- uses: actions/checkout@v4
193199
- name: Run Trivy vulnerability scanner in repo mode

0 commit comments

Comments
 (0)