aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/trivy.yml
blob: 2c95799470dd1fb66c15ed935f214b3305ab98a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: trivy

on:
  push:
    branches:
      - main
    tags:
      - '*'
  pull_request:
    branches: [ "main" ]
  schedule:
    - cron: '00 12 * * *'

permissions:
  contents: read

jobs:
  trivy-scan:
    name: Check
    runs-on: ubuntu-22.04
    timeout-minutes: 30
    permissions:
      contents: read
      security-events: write
      actions: read
    steps:
      - name: Checkout code
        uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7

      - name: Run Trivy vulnerability scanner
        uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # v0.23.0
        with:
          scan-type: repo
          ignore-unfixed: true
          format: sarif
          output: trivy-results.sarif
          severity: CRITICAL,HIGH

      - name: Upload Trivy scan results to GitHub Security tab
        uses: github/codeql-action/upload-sarif@2bbafcdd7fbf96243689e764c2f15d9735164f33 # v3.25.10
        with:
          sarif_file: 'trivy-results.sarif'