diff --git a/README.md b/README.md index 6935302..1f9a6cb 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/action.yml b/action.yml index 929e678..0ba986c 100644 --- a/action.yml +++ b/action.yml @@ -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" @@ -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