Skip to content

Commit

Permalink
[CI] Do not run Trivy scan by default (1.0.x branch)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
onobc committed Nov 7, 2024
1 parent d8397fb commit f030e7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,9 @@ jobs:
-PspringPulsarVersion="$VERSION" \
-PspringBootVersion="$BOOT_VERSION" \
:runAllSampleTests
scan:
needs: [prerequisites]
if: needs.prerequisites.outputs.runjobs
uses: ./.github/workflows/trivy-scan.yml

done:
runs-on: ubuntu-latest
needs: [ build_and_verify, check_samples, scan ]
needs: [ build_and_verify, check_samples ]
steps:
- name: 'Done'
shell: bash
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on:
paths-ignore:
- '.github/**'
workflow_dispatch:
inputs:
run-trivy-scan:
description: 'Run Trivy scan ?'
default: false
required: false
type: boolean

env:
GCHAT_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}
Expand Down Expand Up @@ -89,7 +95,7 @@ jobs:
:runAllSampleTests
scan:
needs: [prerequisites]
if: needs.prerequisites.outputs.runjobs
if: ${{ needs.prerequisites.outputs.runjobs && inputs.run-trivy-scan }}
uses: ./.github/workflows/trivy-scan.yml
deploy_artifacts:
name: Deploy Artifacts (1.0.x)
Expand Down

0 comments on commit f030e7b

Please sign in to comment.