Skip to content

Commit d0a7d56

Browse files
committed
Refine the Anchore SCA workflow #1728
Signed-off-by: tdruez <[email protected]>
1 parent 1a90193 commit d0a7d56

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed
Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1-
name: Generate SBOM with Anchore (Syft and Grype) and load into ScanCode.io
1+
name: Generate SBOM with Anchore Grype and load into ScanCode.io
2+
3+
# This workflow:
4+
# 1. Generates a CycloneDX SBOM for a container image using Anchore Grype.
5+
# 2. Uploads the SBOM as a GitHub artifact for future inspection.
6+
# 3. Loads the SBOM into ScanCode.io for further analysis.
7+
# 4. Runs assertions to verify that the SBOM was properly processed in ScanCode.io.
8+
#
9+
# It runs on demand, and once a week (scheduled).
210

311
on:
412
workflow_dispatch:
513
pull_request:
614
push:
715
branches:
816
- main
17+
schedule:
18+
# Run once a week (every 7 days) at 00:00 UTC on Sunday
19+
- cron: "0 0 * * 0"
920

1021
permissions:
1122
contents: read
@@ -17,24 +28,7 @@ jobs:
1728
generate-and-load-sbom:
1829
runs-on: ubuntu-24.04
1930
steps:
20-
# - name: Generate CycloneDX SBOM with Anchore Syft
21-
# uses: anchore/sbom-action@v0
22-
# with:
23-
# image: ${{ env.IMAGE_REFERENCE }}
24-
# format: cyclonedx-json
25-
# output-file: "${{ github.event.repository.name }}-sbom.cdx.json"
26-
# artifact-name: "anchore-sylt-sbom.cdx.json"
27-
# upload-artifact: true
28-
#
29-
# - name: Scan SBOM with Grype scanner for vulnerabilities
30-
# uses: anchore/scan-action@v6
31-
# with:
32-
# sbom: "${{ github.event.repository.name }}-sbom.cdx.json"
33-
# output-format: cyclonedx-json
34-
# output-file: "anchore-grype-sbom.cdx.json"
35-
# fail-build: false
36-
37-
- name: Scan image
31+
- name: Generate CycloneDX SBOM with Anchore Grype scanner
3832
uses: anchore/scan-action@v6
3933
with:
4034
image: ${{ env.IMAGE_REFERENCE }}
@@ -45,7 +39,6 @@ jobs:
4539
- name: Upload SBOM as GitHub Artifact
4640
uses: actions/upload-artifact@v4
4741
with:
48-
name: anchore-grype-sbom
4942
path: "anchore-grype-sbom.cdx.json"
5043
retention-days: 20
5144

@@ -58,4 +51,4 @@ jobs:
5851
- name: Verify SBOM Analysis Results in ScanCode.io
5952
shell: bash
6053
run: |
61-
scanpipe shell --command "from scanpipe.models import DiscoveredPackage, DiscoveredDependency; package_manager = DiscoveredPackage.objects; print(package_manager.count()); print(package_manager.vulnerable().count()); print(DiscoveredDependency.objects.count())"
54+
scanpipe shell --command "from scanpipe.models import DiscoveredPackage, DiscoveredDependency; package_manager = DiscoveredPackage.objects; assert package_manager.count() > 3200; assert package_manager.vulnerable().count() > 40; assert DiscoveredDependency.objects.count() > 220"

0 commit comments

Comments
 (0)