-
-
Notifications
You must be signed in to change notification settings - Fork 192
50 lines (43 loc) · 1.59 KB
/
sca-integration-ort.yml
File metadata and controls
50 lines (43 loc) · 1.59 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
name: Generate SBOM with ORT and load into ScanCode.io
# This workflow:
# 1. Generates a CycloneDX SBOM for a requirement.txt file using ORT.
# 2. Uploads the SBOM as a GitHub artifact for future inspection.
# 3. Loads the SBOM into ScanCode.io for further analysis.
# 4. Runs assertions to verify that the SBOM was properly processed in ScanCode.io.
#
# It runs on demand, and once a week (scheduled).
on:
workflow_dispatch:
schedule:
# Run once a week (every 7 days) at 00:00 UTC on Sunday
- cron: "0 0 * * 0"
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
generate-and-load-sbom:
runs-on: ubuntu-24.04
steps:
- name: Create a Python requirements.txt
run: |
cat << 'EOF' > requirements.txt
amqp==5.1.1
appdirs==1.4.4
asgiref==3.5.2
urllib3==1.26.0
EOF
- name: Run GitHub Action for ORT
uses: oss-review-toolkit/ort-ci-github-action@v1
- name: Import SBOM into ScanCode.io
uses: aboutcode-org/scancode-action@main
with:
pipelines: "load_sbom"
inputs-path: "${{ env.ORT_RESULTS_PATH }}/bom.cyclonedx.json"
scancodeio-repo-branch: "main"
- name: Verify SBOM Analysis Results in ScanCode.io
shell: bash
run: |
scanpipe shell --command "from scanpipe.models import DiscoveredPackage, DiscoveredDependency; package_manager = DiscoveredPackage.objects; assert package_manager.count() >= 5; assert package_manager.vulnerable().count() >= 1; assert DiscoveredDependency.objects.count() >= 1"