Skip to content

Commit 48886b4

Browse files
committed
chore: more tweaks
1 parent 23c579e commit 48886b4

3 files changed

Lines changed: 41 additions & 21 deletions

File tree

.github/workflows/demo-build-and-scan-docker-image.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313
environment: demo
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
with:
19+
ref: main
20+
1621
- name: Set up Node.js
1722
uses: actions/setup-node@v4
1823
with:
@@ -28,6 +33,9 @@ jobs:
2833
- name: Generate SBOM for local Docker image
2934
run: |
3035
cdxgen -t docker -o sbom.json -r herodevs/eol-scan:local
36+
37+
- name: Verify SBOM exists
38+
run: ls -l sbom.json
3139

3240
- name: Upload SBOM artifact
3341
uses: actions/upload-artifact@v4
@@ -59,4 +67,4 @@ jobs:
5967
uses: actions/upload-artifact@v4
6068
with:
6169
name: herodevs-report
62-
path: herodevs.report.json
70+
path: ./herodevs.report.json

.github/workflows/demo-docker-buildx-sbom-scan.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ env:
99

1010
jobs:
1111
build-and-sbom:
12-
name: Build Docker image & Generate SBOM
13-
environment: demo
12+
name: Build Docker Image & Generate SBOM
1413
runs-on: ubuntu-latest
14+
environment: demo
1515
steps:
16+
# Checkout the repo
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
with:
20+
ref: main
21+
22+
# Set up Node.js
1623
- name: Set up Node.js
1724
uses: actions/setup-node@v4
1825
with:
@@ -21,28 +28,26 @@ jobs:
2128
- name: Set up Docker Buildx
2229
uses: docker/setup-buildx-action@v3
2330

24-
- name: Enable BuildKit experimental features
25-
run: |
26-
export DOCKER_CLI_EXPERIMENTAL=enabled
27-
28-
- name: Build Docker image and generate SBOM
31+
- name: Build Docker image with SBOM
2932
run: |
3033
docker buildx build \
31-
--file ./ci/image.Dockerfile \
34+
--file ci/image.Dockerfile \
3235
--tag herodevs/eol-scan:local \
33-
--sbom=type=cyclonedx,output=sbom.json \
3436
--platform linux/amd64 \
35-
--load \
36-
.
37+
--sbom=type=cyclonedx,output=sbom.json \
38+
--load
39+
40+
- name: Verify SBOM
41+
run: ls -l sbom.json
3742

3843
- name: Upload SBOM artifact
3944
uses: actions/upload-artifact@v4
4045
with:
41-
name: docker-buildx-sbom-json
46+
name: cdxgen-sbom-json
4247
path: sbom.json
4348

4449
scan-sbom:
45-
name: Run HD Scan
50+
name: Run HeroDevs EOL Scan
4651
runs-on: ubuntu-latest
4752
needs: build-and-sbom
4853
steps:
@@ -54,7 +59,7 @@ jobs:
5459
- name: Download SBOM artifact
5560
uses: actions/download-artifact@v4
5661
with:
57-
name: docker-buildx-sbom-json
62+
name: cdxgen-sbom-json
5863
path: .
5964

6065
- name: Run EOL scan

.github/workflows/demo-scan-with-image.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,24 @@ jobs:
1212
runs-on: ubuntu-latest
1313
environment: demo
1414
steps:
15-
- uses: actions/checkout@v4
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
1617
with:
1718
ref: main
1819

1920
- name: Run EOL Scan with Docker
20-
uses: docker://ghcr.io/herodevs/eol-scan
21-
with:
22-
args: "-s"
23-
21+
run: |
22+
# Create output directory
23+
mkdir -p output
24+
25+
# Run container with volume mount to write report
26+
docker run --rm \
27+
-v ${{ github.workspace }}/output:/workspace \
28+
-w /workspace \
29+
ghcr.io/herodevs/eol-scan -s
30+
2431
- name: Upload artifact
2532
uses: actions/upload-artifact@v4
2633
with:
2734
name: my-eol-report
28-
path: herodevs.report.json
35+
path: output/herodevs.report.json

0 commit comments

Comments
 (0)