Skip to content

Commit e0a8e53

Browse files
authored
Install ScanCode.io from the GitHub repository (#14)
Signed-off-by: tdruez <[email protected]>
1 parent a1eabe1 commit e0a8e53

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Workflows.
2222
- [Provide download URLs inputs](#provide-download-urls-inputs)
2323
- [Fetch pipelines inputs](#fetch-pipelines-inputs)
2424
- [Define a custom project name](#define-a-custom-project-name)
25+
- [Install ScanCode.io from a repository branch](#install-scancodeio-from-a-repository-branch)
2526
- [Where does the scan results go?](#where-does-the-scan-results-go)
2627

2728
## Usage
@@ -159,6 +160,14 @@ For details on setting up and configuring your own instance, please refer to the
159160
project-name: "my-project-name"
160161
```
161162

163+
### Install ScanCode.io from a repository branch
164+
165+
```yaml
166+
- uses: nexB/scancode-action@alpha
167+
with:
168+
scancodeio-repo-branch: "main"
169+
```
170+
162171
## Where are the Scan Results?
163172

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

action.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ inputs:
2323
python-version:
2424
description: "Python version"
2525
default: "3.11"
26+
scancodeio-repo-branch:
27+
description: "Branch to install ScanCode.io from the GitHub repository (optional)"
28+
required: false
29+
default: ""
2630

2731
runs:
2832
using: "composite"
@@ -50,8 +54,17 @@ runs:
5054
- name: Install ScanCode.io
5155
shell: bash
5256
run: |
53-
pip install --upgrade scancodeio
54-
scanpipe migrate
57+
if [ -z "${{ inputs.scancodeio-repo-branch }}" ]; then
58+
echo "Installing the latest ScanCode.io release from PyPI"
59+
pip install --upgrade scancodeio
60+
else
61+
echo "Installing ScanCode.io from the GitHub branch: ${{ inputs.scancodeio-repo-branch }}"
62+
pip install git+https://github.com/aboutcode-org/scancode.io.git@${{ inputs.scancodeio-repo-branch }}
63+
fi
64+
65+
- name: Run migrations to prepare the database
66+
shell: bash
67+
run: scanpipe migrate
5568

5669
- name: Generate `--pipeline` CLI arguments
5770
shell: bash

0 commit comments

Comments
 (0)