Skip to content

Commit 7f321b0

Browse files
committed
Add a workflow for the ScanCode.io to ORT integration
Signed-off-by: tdruez <[email protected]>
1 parent 31ba3be commit 7f321b0

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Generate ORT package-file.yml with ScanCode.io and load into ORT
2+
3+
# This workflow:
4+
# 1. Analyze a Docker image using ScanCode.io
5+
# 1. Generates an ORT `package-file.yml` from the project results
6+
# 2. Generates an ORT `analyzer-result.yml` using create-analyzer-result-from-package-list
7+
# 3. Run the ORT report on `analyzer-result.yml` to generate a CycloneDX and SpdxDocument
8+
9+
on:
10+
workflow_dispatch:
11+
# schedule:
12+
# # Run once a week (every 7 days) at 00:00 UTC on Sunday
13+
# - cron: "0 0 * * 0"
14+
pull_request:
15+
push:
16+
branches:
17+
- main
18+
19+
permissions:
20+
contents: read
21+
22+
env:
23+
SCIO_IMAGE_INPUT: "docker://osadl/alpine-docker-base-image:v3.22-latest"
24+
ORT_VERSION: "68.1.0"
25+
26+
jobs:
27+
generate-and-load-sbom:
28+
runs-on: ubuntu-24.04
29+
steps:
30+
- name: Analyze Docker image with ScanCode.io
31+
uses: aboutcode-org/scancode-action@main
32+
with:
33+
pipelines: "analyze_docker_image"
34+
input-urls:
35+
"${{ env.SCIO_IMAGE_INPUT }}"
36+
scancodeio-repo-branch: "main"
37+
output-formats: "ort-package-list spdx cyclonedx json xlsx"
38+
39+
- name: DEBUG
40+
run: |
41+
echo ${{ env.PROJECT_WORK_DIRECTORY }}
42+
43+
- name: Generates an ORT analyzer-result.yml file
44+
run: |
45+
docker run --rm -v ${{ env.PROJECT_WORK_DIRECTORY }}/output:/data \
46+
--entrypoint /opt/ort/bin/orth \
47+
ghcr.io/oss-review-toolkit/ort:${{ env.ORT_VERSION }} \
48+
create-analyzer-result-from-package-list \
49+
--package-list-file /data/package-list.yml \
50+
--ort-file /data/analyzer-result.yml
51+
52+
- name: Generates an ORT analyzer-result.yml file
53+
run: |
54+
docker run --rm -v ${{ env.PROJECT_WORK_DIRECTORY }}/output:/data \
55+
ghcr.io/oss-review-toolkit/ort:${{ env.ORT_VERSION }} \
56+
report \
57+
--ort-file /data/analyzer-result.yml \
58+
--output-dir /data/results/ \
59+
--report-formats CycloneDX,SpdxDocument

0 commit comments

Comments
 (0)