-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (109 loc) · 4.12 KB
/
Copy pathpart_licensing.yml
File metadata and controls
128 lines (109 loc) · 4.12 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 Erlang Ecosystem Foundation
on:
workflow_call:
inputs:
attest:
description: "Attest the SBoM"
default: true
type: boolean
name: "Licensing"
permissions:
contents: read
jobs:
sbom:
name: "Generate SBoM"
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
attestations: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Use HTTPS instead of SSH for Git cloning
run: git config --global url.https://github.com/.insteadOf ssh://git@github.com/
- name: Run OSS Review Toolkit
id: ort
uses: oss-review-toolkit/ort-ci-github-action@086d928d24ef1653dc0777296b312fda5faaaf52 # v1.2.0
with:
image: ghcr.io/oss-review-toolkit/ort:80.0.0
run: >-
labels,
cache-dependencies,
cache-scan-results,
analyzer,
scanner,
advisor,
reporter
report-formats: "CycloneDx,SpdxDocument,WebApp"
# TODO: Remove workaround once https://github.com/oss-review-toolkit/ort/pull/11324 is merged
ort-cli-args: >-
-P ort.analyzer.skipExcluded=true
-P ort.scanner.scanners.ScanCode.options.commandLine=--copyright,--license,--info,--strip-root
-P ort.scanner.scanners.ScanCode.options.commandLineNonConfig=--timeout,300
ort-cli-report-args: >-
-O CycloneDX=output.file.formats=json,xml
-O SpdxDocument=outputFileFormats=JSON,YAML
sw-version: "${{ github.ref_type == 'tag' && github.ref_name || github.sha }}"
- name: "Rename SBOMs"
run: |
cp "$CYCLONEDX_XML" sbom.cdx.xml
cp "$CYCLONEDX_JSON" sbom.cdx.json
cp "$SPDX_YML" sbom.spdx.yml
cp "$SPDX_JSON" sbom.spdx.json
env:
CYCLONEDX_XML: "${{ steps.ort.outputs.results-sbom-cyclonedx-xml-path }}"
CYCLONEDX_JSON: "${{ steps.ort.outputs.results-sbom-cyclonedx-json-path }}"
SPDX_YML: "${{ steps.ort.outputs.results-sbom-spdx-yml-path }}"
SPDX_JSON: "${{ steps.ort.outputs.results-sbom-spdx-json-path }}"
- name: "Attest provenance"
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
id: attest-provenance
if: "${{ inputs.attest }}"
with:
subject-path: |
sbom.cdx.xml
sbom.cdx.json
sbom.spdx.yml
sbom.spdx.json
- name: "Copy provenance"
if: "${{ inputs.attest }}"
run: |
cp "$ATTESTATION" sbom.cdx.xml.sigstore
cp "$ATTESTATION" sbom.cdx.json.sigstore
cp "$ATTESTATION" sbom.spdx.yml.sigstore
cp "$ATTESTATION" sbom.spdx.json.sigstore
env:
ATTESTATION: "${{ steps.attest-provenance.outputs.bundle-path }}"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sbom
path: |
sbom.cdx.xml
sbom.cdx.json
sbom.spdx.yml
sbom.spdx.json
sbom.*.sigstore
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sbom_report
path: ${{ steps.ort.outputs.results-path }}/scan-report-web-app.html
check:
name: "Check REUSE Licensing Compliance"
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: REUSE Check
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0