Skip to content

Commit 4e1d7b0

Browse files
committed
[CI] Do not run Trivy scan by default
To get around recent TOOMANYREQUESTS from Trivy during DB download, this commit does the following: - removes the scan from ci-pr.yml altogether - makes scan optional (default false) for ci.yml - schedules scan to run every 3 days at 14:00 UTC
1 parent 168afb3 commit 4e1d7b0

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.github/workflows/ci-pr.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,9 @@ jobs:
105105
-PspringBootVersion="$BOOT_VERSION" \
106106
-PsampleTests \
107107
:runAllSampleTests
108-
scan:
109-
needs: [prerequisites]
110-
if: needs.prerequisites.outputs.runjobs
111-
uses: ./.github/workflows/trivy-scan.yml
112-
113108
done:
114109
runs-on: ubuntu-latest
115-
needs: [ build_and_verify, check_samples, scan ]
110+
needs: [ build_and_verify, check_samples ]
116111
steps:
117112
- name: 'Done'
118113
shell: bash

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ on:
1111
schedule:
1212
- cron: '0 11 * * *' # Once per day at 11am UTC
1313
workflow_dispatch:
14+
inputs:
15+
run-trivy-scan:
16+
description: 'Whether to run Trivy scan'
17+
default: false
18+
required: false
19+
type: boolean
1420

1521
env:
1622
GCHAT_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}
@@ -93,7 +99,7 @@ jobs:
9399
:runAllSampleTests
94100
scan:
95101
needs: [prerequisites]
96-
if: needs.prerequisites.outputs.runjobs
102+
if: ${{ needs.prerequisites.outputs.runjobs && inputs.run-trivy-scan }}
97103
uses: ./.github/workflows/trivy-scan.yml
98104
deploy_artifacts:
99105
name: Deploy Artifacts

.github/workflows/trivy-scan.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ on:
2525
default: false
2626
required: false
2727
type: boolean
28+
schedule:
29+
- cron: '0 14 * * */3' # Once every 3 day at 2pm UTC
2830

2931
jobs:
3032
run_trivy_scan:

0 commit comments

Comments
 (0)