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
4 changes: 1 addition & 3 deletions .github/workflows/map-deploy-to-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ jobs:

- uses: ./
with:
pipelines: "map_deploy_to_develop"
pipelines: "map_deploy_to_develop:Java"
input-urls:
https://github.com/aboutcode-org/scancode.io/raw/main/scanpipe/tests/data/d2d/jars/from-flume-ng-node-1.9.0.zip#from
https://github.com/aboutcode-org/scancode.io/raw/main/scanpipe/tests/data/d2d/jars/to-flume-ng-node-1.9.0.zip#to
env:
PURLDB_URL: https://public.purldb.io/
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Workflows.
- [Scan repo codebase](#scan-repo-codebase)
- [Run a specific pipeline](#run-a-specific-pipeline)
- [Run multiple pipelines](#run-multiple-pipelines)
- [Specify pipeline options](#specify-pipeline-options)
- [Choose the output formats](#choose-the-output-formats)
- [Provide download URLs inputs](#provide-download-urls-inputs)
- [Fetch pipelines inputs](#fetch-pipelines-inputs)
Expand Down Expand Up @@ -123,6 +124,17 @@ steps:
VULNERABLECODE_URL: https://public.vulnerablecode.io/
```

### Specify pipeline options

Use the `pipeline_name:option1,option2` syntax to select optional steps for the
`map_deploy_to_develop` pipeline

```yaml
- uses: aboutcode-org/scancode-action@beta
with:
pipelines: "map_deploy_to_develop:Java,JavaScript"
```

#### Configuring `find_vulnerabilities` Pipeline

The `find_vulnerabilities` pipeline requires access to a VulnerableCode instance,
Expand Down
20 changes: 18 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
default: "json xlsx spdx cyclonedx"
inputs-path:
description: "Relative path within the $GITHUB_WORKSPACE for pipeline inputs"
default: "${{ github.workspace }}/scancode-inputs"
default: "scancode-inputs"
input-urls:
description: "Provide one or more URLs to download for the pipeline run execution."
required: false
Expand Down Expand Up @@ -116,14 +116,30 @@ runs:
echo "PROJECT_WORK_DIRECTORY=$work_directory" >> $GITHUB_ENV

- name: Copy input files to project work directory
if: ${{ !inputs.input-urls }}
shell: bash
run: |
SOURCE_PATH="${{ inputs.inputs-path }}"
[[ "$SOURCE_PATH" != /* ]] && SOURCE_PATH="${{ github.workspace }}/$SOURCE_PATH"
DESTINATION_PATH="${{ env.PROJECT_WORK_DIRECTORY }}/input/"
mkdir -p "$DESTINATION_PATH"

if [ -d "$SOURCE_PATH" ]; then
cp -r "$SOURCE_PATH"/* "$DESTINATION_PATH"
if [ "$(ls -A "$SOURCE_PATH")" ]; then
echo "Copying contents of directory: $SOURCE_PATH → $DESTINATION_PATH"
cp -r "$SOURCE_PATH"/* "$DESTINATION_PATH"
else
echo "Input directory '$SOURCE_PATH' is empty, nothing to copy."
fi
else
echo "Copying file: $SOURCE_PATH → $DESTINATION_PATH"
cp "$SOURCE_PATH" "$DESTINATION_PATH"
fi

echo ""
echo "Input files now in: $DESTINATION_PATH"
ls -lh "$DESTINATION_PATH"

- name: Run the pipelines
shell: bash
run: scanpipe execute --project ${{ inputs.project-name }} --no-color
Expand Down