-
-
Notifications
You must be signed in to change notification settings - Fork 42
56 lines (50 loc) · 1.39 KB
/
analysis.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# https://docs.github.com/actions
name: Analysis
on:
schedule:
- cron: '43 2 * * 6'
workflow_call:
inputs:
artifact:
required: false
default: true
type: string
description: True if analysis must be run against a built artifact
workflow_dispatch:
jobs:
trivy:
name: Trivy
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
matrix:
variant: [fpm-alpine, fpm, apache]
steps:
- name: Retrieve image artifact
uses: actions/download-artifact@v4
if: inputs.artifact
with:
name: ${{ matrix.variant }}-image
- name: Run Trivy scanner
uses: aquasecurity/trivy-action@0.16.1
if: inputs.artifact
with:
input: container-image.tar
format: template
template: '@/contrib/sarif.tpl'
output: results.sarif
- name: Run Trivy scanner
uses: aquasecurity/trivy-action@0.16.1
if: "! inputs.artifact"
with:
image-ref: ghcr.io/${{ vars.REGISTRY_IMAGE }}:${{ matrix.variant }}
format: template
template: '@/contrib/sarif.tpl'
output: results.sarif
- name: Upload scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif