Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Workflows.
- [Provide download URLs inputs](#provide-download-urls-inputs)
- [Fetch pipelines inputs](#fetch-pipelines-inputs)
- [Define a custom project name](#define-a-custom-project-name)
- [Install ScanCode.io from a repository branch](#install-scancodeio-from-a-repository-branch)
- [Where does the scan results go?](#where-does-the-scan-results-go)

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

### Install ScanCode.io from a repository branch

```yaml
- uses: nexB/scancode-action@alpha
with:
scancodeio-repo-branch: "main"
```

## Where are the Scan Results?

Upon completion of the workflow, you can **find the scan results** in the dedicated
Expand Down
17 changes: 15 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ inputs:
python-version:
description: "Python version"
default: "3.11"
scancodeio-repo-branch:
description: "Branch to install ScanCode.io from the GitHub repository (optional)"
required: false
default: ""

runs:
using: "composite"
Expand Down Expand Up @@ -50,8 +54,17 @@ runs:
- name: Install ScanCode.io
shell: bash
run: |
pip install --upgrade scancodeio
scanpipe migrate
if [ -z "${{ inputs.scancodeio-repo-branch }}" ]; then
echo "Installing the latest ScanCode.io release from PyPI"
pip install --upgrade scancodeio
else
echo "Installing ScanCode.io from the GitHub branch: ${{ inputs.scancodeio-repo-branch }}"
pip install git+https://github.com/aboutcode-org/scancode.io.git@${{ inputs.scancodeio-repo-branch }}
fi

- name: Run migrations to prepare the database
shell: bash
run: scanpipe migrate

- name: Generate `--pipeline` CLI arguments
shell: bash
Expand Down