Skip to content

Commit 8d976d8

Browse files
committed
feat(ci): add SBOM generation
1 parent 502cc5e commit 8d976d8

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Analyze module
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
permissions:
9+
packages: write
10+
actions: read
11+
contents: write
12+
security-events: write
13+
14+
15+
jobs:
16+
generate-sbom:
17+
name: Generate SBOM
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
directory: [don, ronzinante, sancho]
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v3
25+
26+
- name: Update Dependency Graph
27+
uses: aquasecurity/trivy-action@0.30.0
28+
with:
29+
scan-type: 'fs'
30+
scan-ref: '${{ matrix.directory }}'
31+
format: 'github'
32+
33+
- name: Generate Sarif Report
34+
uses: aquasecurity/trivy-action@0.30.0
35+
with:
36+
scan-type: 'fs'
37+
scan-ref: '${{ matrix.directory }}'
38+
format: sarif
39+
output: '${{ matrix.directory }}_windmill.sarif'
40+
41+
- name: Generate SBOM
42+
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
43+
uses: aquasecurity/trivy-action@0.30.0
44+
with:
45+
scan-type: 'fs'
46+
scan-ref: '${{ matrix.directory }}'
47+
format: cyclonedx
48+
output: '${{ matrix.directory }}_windmill.cdx.json'
49+
50+
- name: Attach SBOM Release
51+
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
52+
env:
53+
GH_TOKEN: ${{ github.token }}
54+
run: |
55+
gh release --repo ${{ github.repository }} upload ${{ github.event.release.tag_name }} ${{ matrix.directory }}_windmill.cdx.json

0 commit comments

Comments
 (0)