Merge branch 'kedacore:main' into refactor-datadog-scaler #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Reusable workflow to run trivy scan | |
on: | |
workflow_call: | |
inputs: | |
runs-on: | |
required: true | |
type: string | |
scan-type: | |
required: true | |
type: string | |
format: | |
required: true | |
type: string | |
output: | |
required: false | |
type: string | |
default: trivy.sarif | |
image-ref: | |
required: false | |
type: string | |
default: "" | |
severity: | |
required: false | |
type: string | |
default: "CRITICAL,HIGH" | |
exit-code: | |
required: true | |
type: number | |
publish: | |
required: true | |
type: boolean | |
jobs: | |
trivy-scan: | |
name: Trivy - ${{ inputs.runs-on }} - ${{ inputs.scan-type }} ${{ inputs.image-ref }} | |
runs-on: ${{ inputs.runs-on }} | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Run Trivy | |
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0 | |
env: | |
TRIVY_DB_REPOSITORY: ghcr.io/kedacore/trivy-db | |
with: | |
scan-type: ${{ inputs.scan-type }} | |
image-ref: ${{ inputs.image-ref }} | |
ignore-unfixed: false | |
format: ${{ inputs.format }} | |
output: ${{ inputs.output }} | |
exit-code: ${{ inputs.exit-code }} | |
severity: ${{ inputs.severity }} | |
trivy-config: trivy.yml | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 | |
if: ${{ inputs.publish }} | |
with: | |
sarif_file: ${{ inputs.output }} |