Skip to content

Trivy Vulnerability Scan (Repo mode) #27

Trivy Vulnerability Scan (Repo mode)

Trivy Vulnerability Scan (Repo mode) #27

Workflow file for this run

name: Trivy Vulnerability Scan (Repo mode)
on:
workflow_dispatch:
inputs:
config-path:
description: 'Relative path to Trivy config file'
default: '.github/trivy.yaml'
required: false
type: string
workflow_call:
inputs:
config-path:
description: 'Relative path to Trivy config file'
default: '.github/trivy.yaml'
required: false
type: string
jobs:
run_trivy_scan:
name: Run Trivy Scan
runs-on: ubuntu-latest
env:
LOCAL_REPOSITORY_PATH: ./build/publications/repos
steps:
- uses: actions/checkout@v3
- uses: spring-io/spring-gradle-build-action@v2
- name: Publish to local repo (poms)
run: |
./gradlew publishMavenJavaPublicationToLocalRepository
- name: Run Trivy scan in repo mode (fs)
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '${{ env.LOCAL_REPOSITORY_PATH }}/org/springframework/pulsar'
trivy-config: ${{ inputs.config-path }}