Skip to content

Commit a6f1de8

Browse files
committed
Merge main and resolve conflicts
Signed-off-by: tdruez <[email protected]>
2 parents 7e86b09 + e46d127 commit a6f1de8

File tree

8 files changed

+199
-45
lines changed

8 files changed

+199
-45
lines changed

.github/workflows/analyze-docker-image.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@ on: [push]
22

33
jobs:
44
scan-codebase:
5-
runs-on: ubuntu-22.04
6-
name: Analyze a Docker image with ScanCode.io
5+
runs-on: ubuntu-24.04
6+
name: Analyze a Docker image
77
steps:
8-
- uses: nexB/scancode-action@alpha
8+
- name: Get the action.yml from the current branch
9+
uses: actions/checkout@v4
10+
with:
11+
sparse-checkout: action.yml
12+
sparse-checkout-cone-mode: false
13+
14+
- uses: ./
915
with:
1016
pipelines: "analyze_docker_image"
1117
input-urls:
12-
https://github.com/nexB/scancode.io-tutorial/releases/download/sample-images/30-alpine-nickolashkraus-staticbox-latest.tar
18+
https://github.com/aboutcode-org/scancode.io-tutorial/releases/download/sample-images/30-alpine-nickolashkraus-staticbox-latest.tar
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on: [push]
2+
3+
jobs:
4+
scan-codebase:
5+
runs-on: ubuntu-24.04
6+
name: Scan codebase and find vulnerabilities
7+
steps:
8+
- name: Get the action.yml from the current branch
9+
uses: actions/checkout@v4
10+
with:
11+
sparse-checkout: action.yml
12+
sparse-checkout-cone-mode: false
13+
14+
- uses: actions/checkout@v4
15+
with:
16+
path: scancode-inputs
17+
- uses: ./
18+
with:
19+
pipelines: "scan_codebase,find_vulnerabilities"
20+
scancodeio-repo-branch: "main"
21+
check-compliance: true
22+
compliance-fail-on-vulnerabilities: true
23+
env:
24+
VULNERABLECODE_URL: https://public.vulnerablecode.io/

.github/workflows/map-deploy-to-develop.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ on: [push]
22

33
jobs:
44
scan-codebase:
5-
runs-on: ubuntu-22.04
6-
name: Map deploy to develop with ScanCode.io
5+
runs-on: ubuntu-24.04
6+
name: Map deploy to develop
77
steps:
8-
- uses: nexB/scancode-action@alpha
8+
- name: Get the action.yml from the current branch
9+
uses: actions/checkout@v4
10+
with:
11+
sparse-checkout: action.yml
12+
sparse-checkout-cone-mode: false
13+
14+
- uses: ./
915
with:
1016
pipelines: "map_deploy_to_develop"
1117
input-urls:
12-
https://github.com/nexB/scancode.io/raw/main/scanpipe/tests/data/d2d/jars/from-flume-ng-node-1.9.0.zip#from
13-
https://github.com/nexB/scancode.io/raw/main/scanpipe/tests/data/d2d/jars/to-flume-ng-node-1.9.0.zip#to
18+
https://github.com/aboutcode-org/scancode.io/raw/main/scanpipe/tests/data/d2d/jars/from-flume-ng-node-1.9.0.zip#from
19+
https://github.com/aboutcode-org/scancode.io/raw/main/scanpipe/tests/data/d2d/jars/to-flume-ng-node-1.9.0.zip#to
1420
env:
1521
PURLDB_URL: https://public.purldb.io/

.github/workflows/scan-codebase.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ on: [push]
22

33
jobs:
44
scan-codebase:
5-
runs-on: ubuntu-22.04
6-
name: Scan codebase with ScanCode.io
5+
runs-on: ubuntu-24.04
6+
name: Scan codebase and check for compliance issues
77
steps:
8+
- name: Get the action.yml from the current branch
9+
uses: actions/checkout@v4
10+
with:
11+
sparse-checkout: action.yml
12+
sparse-checkout-cone-mode: false
13+
814
- uses: actions/checkout@v4
915
with:
1016
path: scancode-inputs
11-
- uses: nexB/scancode-action@alpha
17+
- uses: ./
1218
with:
13-
pipelines: "scan_codebase,find_vulnerabilities"
14-
env:
15-
VULNERABLECODE_URL: https://public.vulnerablecode.io/
19+
pipelines: "scan_codebase"
20+
check-compliance: true
21+
compliance-fail-level: "WARNING"

.github/workflows/scan-single-package.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ on: [push]
22

33
jobs:
44
scan-codebase:
5-
runs-on: ubuntu-22.04
6-
name: Scan package with ScanCode.io
5+
runs-on: ubuntu-24.04
6+
name: Scan a package archive
77
steps:
8-
- name: Download repository archive to scancode-inputs/ directory
9-
run: |
10-
wget --directory-prefix=scancode-inputs https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_REF}.zip
11-
- uses: nexB/scancode-action@alpha
8+
- name: Get the action.yml from the current branch
9+
uses: actions/checkout@v4
10+
with:
11+
sparse-checkout: action.yml
12+
sparse-checkout-cone-mode: false
13+
14+
- uses: ./
1215
with:
1316
pipelines: "scan_single_package"
17+
input-urls:
18+
https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_REF}.zip

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,6 @@ typings/
9696

9797
# Editor
9898
.idea
99+
100+
# Various junk and temp files
101+
.DS_Store

README.md

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# `@nexB/scancode-action`
1+
# `@aboutcode-org/scancode-action`
22

3-
Run [ScanCode.io](https://github.com/nexB/scancode.io) pipelines from your Workflows.
3+
Run [ScanCode.io](https://github.com/aboutcode-org/scancode.io) pipelines from your
4+
Workflows.
45

56
> [!IMPORTANT]
6-
> The scancode-action is currently in the **alpha stage**, and we invite you to
7+
> The scancode-action is currently in the **beta stage**, and we invite you to
78
> contribute to its improvement. Please feel free to submit bug reports or share
89
> your ideas by creating new entries in the "Issues" section.
910
> Your collaboration helps us enhance the action and ensures a more stable and
@@ -20,7 +21,9 @@ Run [ScanCode.io](https://github.com/nexB/scancode.io) pipelines from your Workf
2021
- [Choose the output formats](#choose-the-output-formats)
2122
- [Provide download URLs inputs](#provide-download-urls-inputs)
2223
- [Fetch pipelines inputs](#fetch-pipelines-inputs)
24+
- [Check for compliance issues](#check-for-compliance-issues)
2325
- [Define a custom project name](#define-a-custom-project-name)
26+
- [Install ScanCode.io from a repository branch](#install-scancodeio-from-a-repository-branch)
2427
- [Where does the scan results go?](#where-does-the-scan-results-go)
2528

2629
## Usage
@@ -32,7 +35,7 @@ steps:
3235
- uses: actions/checkout@v4
3336
with:
3437
path: scancode-inputs
35-
- uses: nexB/scancode-action@alpha
38+
- uses: aboutcode-org/scancode-action@beta
3639
with:
3740
pipelines: "scan_codebase"
3841
output-formats: "json xlsx spdx cyclonedx"
@@ -41,7 +44,7 @@ steps:
4144
### Inputs
4245
4346
```yaml
44-
- uses: nexB/scancode-action@alpha
47+
- uses: aboutcode-org/scancode-action@beta
4548
with:
4649
# Names of the pipelines (comma-separated) and in order.
4750
# Default is 'scan_codebase'
@@ -66,15 +69,29 @@ steps:
6669
# Default is 'scancode-outputs'
6770
outputs-archive-name:
6871

72+
# Check for compliance issues in the project.
73+
# Exits with a non-zero status if compliance issues are detected.
74+
# Default is false
75+
check-compliance:
76+
77+
# Failure level for compliance check. Options: ERROR, WARNING, MISSING.
78+
# Default is 'ERROR'
79+
compliance-fail-level:
80+
81+
# Exit with a non-zero status if known vulnerabilities are detected in discovered
82+
# packages and dependencies.
83+
# Default is false
84+
compliance-fail-on-vulnerabilities:
85+
6986
# Python version that will be installed to run ScanCode.io
70-
# Default is '3.11'
87+
# Default is '3.12'
7188
python-version:
7289
```
7390
7491
## Examples
7592
76-
See https://github.com/nexB/scancode-action/tree/main/.github/workflows for Workflows
77-
examples.
93+
See https://github.com/aboutcode-org/scancode-action/tree/main/.github/workflows for
94+
Workflows examples.
7895
7996
### Scan repo codebase
8097
@@ -83,23 +100,23 @@ steps:
83100
- uses: actions/checkout@v4
84101
with:
85102
path: scancode-inputs
86-
- uses: nexB/scancode-action@alpha
103+
- uses: aboutcode-org/scancode-action@beta
87104
```
88105
89106
### Run a specific pipeline
90107
91108
[Built-in pipelines list](https://scancodeio.readthedocs.io/en/latest/built-in-pipelines.html)
92109
93110
```yaml
94-
- uses: nexB/scancode-action@alpha
111+
- uses: aboutcode-org/scancode-action@beta
95112
with:
96113
pipelines: "scan_codebase"
97114
```
98115
99116
### Run multiple pipelines
100117
101118
```yaml
102-
- uses: nexB/scancode-action@alpha
119+
- uses: aboutcode-org/scancode-action@beta
103120
with:
104121
pipelines: "scan_codebase,find_vulnerabilities"
105122
env:
@@ -116,18 +133,39 @@ However, you also have the option to run your own VulnerableCode instance.
116133
For details on setting up and configuring your own instance, please refer to the
117134
[VulnerableCode documentation](https://vulnerablecode.readthedocs.io/en/latest/index.html).
118135

136+
#### Fail on known vulnerabilities
137+
138+
When enabled, the workflow will fail if any known vulnerabilities are found in the
139+
project's discovered packages or dependencies.
140+
Activate this behavior by enabling `check-compliance` and setting
141+
`compliance-fail-on-vulnerabilities` to true.
142+
143+
```yaml
144+
- uses: aboutcode-org/scancode-action@beta
145+
with:
146+
pipelines: "scan_codebase,find_vulnerabilities"
147+
check-compliance: true
148+
compliance-fail-on-vulnerabilities: true
149+
env:
150+
VULNERABLECODE_URL: https://public.vulnerablecode.io/
151+
```
152+
119153
### Choose the output formats
120154

121155
```yaml
122-
- uses: nexB/scancode-action@alpha
156+
- uses: aboutcode-org/scancode-action@beta
123157
with:
124158
output-formats: "json xlsx spdx cyclonedx"
125159
```
126160

161+
> [!NOTE]
162+
> To specify a CycloneDX spec version (default to latest), use the syntax
163+
``cyclonedx:VERSION`` as format value. For example: ``cyclonedx:1.5``.
164+
127165
### Provide download URLs inputs
128166

129167
```yaml
130-
- uses: nexB/scancode-action@alpha
168+
- uses: aboutcode-org/scancode-action@beta
131169
with:
132170
pipelines: "map_deploy_to_develop"
133171
input-urls:
@@ -141,19 +179,41 @@ For details on setting up and configuring your own instance, please refer to the
141179
- name: Download repository archive to scancode-inputs/ directory
142180
run: |
143181
wget --directory-prefix=scancode-inputs https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_REF}.zip
144-
- uses: nexB/scancode-action@alpha
182+
- uses: aboutcode-org/scancode-action@beta
145183
with:
146184
pipelines: "scan_single_package"
147185
```
148186

187+
### Check for compliance issues
188+
189+
```yaml
190+
- uses: aboutcode-org/scancode-action@beta
191+
with:
192+
check-compliance: true
193+
compliance-fail-level: "WARNING"
194+
```
195+
196+
> [!NOTE]
197+
> This feature requires to provide Project policies.
198+
> For details on setting up and configuring your own instance, please refer to the
199+
> [ScanCode.io Policies documentation](https://scancodeio.readthedocs.io/en/latest/policies.html).
200+
149201
### Define a custom project name
150202

151203
```yaml
152-
- uses: nexB/scancode-action@alpha
204+
- uses: aboutcode-org/scancode-action@beta
153205
with:
154206
project-name: "my-project-name"
155207
```
156208

209+
### Install ScanCode.io from a repository branch
210+
211+
```yaml
212+
- uses: aboutcode-org/scancode-action@beta
213+
with:
214+
scancodeio-repo-branch: "main"
215+
```
216+
157217
## Where are the Scan Results?
158218

159219
Upon completion of the workflow, you can **find the scan results** in the dedicated

0 commit comments

Comments
 (0)