Skip to content

Commit 02e0e2e

Browse files
authored
Run the local action (current branch code) in the workflows (#15)
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent 02f17b5 commit 02e0e2e

File tree

7 files changed

+47
-19
lines changed

7 files changed

+47
-19
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ 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:

.github/workflows/find-vulnerabilities.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@ 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 find vulnerabilities
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:
1319
pipelines: "scan_codebase,find_vulnerabilities"
1420
env:

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ 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:

.github/workflows/scan-codebase.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ jobs:
55
runs-on: ubuntu-24.04
66
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-
- name: Run scancode-action from current branch
12-
uses: ./scancode-inputs
17+
- uses: ./
1318
with:
1419
pipelines: "scan_codebase"
1520
check-compliance: true

.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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ steps:
7979
compliance-fail-level:
8080

8181
# Python version that will be installed to run ScanCode.io
82-
# Default is '3.11'
82+
# Default is '3.12'
8383
python-version:
8484
```
8585

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ inputs:
3030
required: false
3131
python-version:
3232
description: "Python version."
33-
default: "3.11"
33+
default: "3.12"
3434
scancodeio-repo-branch:
3535
description: "Branch to install ScanCode.io from the GitHub repository (optional)"
3636
required: false

0 commit comments

Comments
 (0)