-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdemo-build-and-scan-docker-image.yml
More file actions
66 lines (53 loc) · 1.66 KB
/
demo-build-and-scan-docker-image.yml
File metadata and controls
66 lines (53 loc) · 1.66 KB
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
57
58
59
60
61
62
63
64
65
66
name: (DEMO) HeroDevs CLI Build and Scan Docker Image
on:
workflow_dispatch: {}
env:
TRACKING_OPT_OUT: 'true'
CDXGEN_DEBUG_MODE: 'debug' # recommended for more verbose output from cdxgen
jobs:
build-and-sbom:
name: Build and Generate SBOM
environment: demo
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Install cdxgen
run: npm install -g @cyclonedx/cdxgen
- name: Build Docker image
working-directory: ${{ github.workspace }}
run: docker build -f ./ci/demo.Dockerfile -t herodevs/demo-image:local .
- name: Generate SBOM for local Docker image
run: cdxgen -t docker -o sbom.json -r herodevs/demo-image:local
- name: Verify SBOM exists
run: ls -l sbom.json
- name: Upload SBOM artifact
uses: actions/upload-artifact@v5
with:
name: cdxgen-sbom-json
path: sbom.json
scan-sbom:
name: Run HD Scan
runs-on: ubuntu-latest
needs: build-and-sbom
steps:
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Download SBOM artifact
uses: actions/download-artifact@v7
with:
name: cdxgen-sbom-json
path: .
- name: Run EOL scan
run: npx @herodevs/cli@beta scan eol --file=sbom.json --save
- name: Upload HD report
uses: actions/upload-artifact@v5
with:
name: herodevs-report
path: ./herodevs.report.json