diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 12db4ef..15199a6 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -26,6 +26,7 @@ jobs: uses: ./ with: # sbom-ignore: 'scanoss-ignore.json' + with-dependencies: true github-token: ${{ secrets.GITHUB_TOKEN }} - name: Print stdout scan command diff --git a/action.yml b/action.yml index db56e75..8c5beaf 100644 --- a/action.yml +++ b/action.yml @@ -28,6 +28,9 @@ inputs: api-url: description: 'SCANOSS API URL (optional - default: https://osskb.org/api/scan/direct)' required: false + with-dependencies: + description: Scan dependencies (optional - default false) + required: false # Define your outputs here. outputs: diff --git a/dist/index.js b/dist/index.js index 2731fc1..bb835cb 100644 --- a/dist/index.js +++ b/dist/index.js @@ -30178,7 +30178,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.API_URL = exports.API_KEY = exports.SBOM_IGNORE = exports.SBOM_INDENTIFY = exports.OUTPUT_PATH = exports.REPO_DIR = void 0; +exports.WITH_DEPENDENCIES = exports.API_URL = exports.API_KEY = exports.SBOM_IGNORE = exports.SBOM_INDENTIFY = exports.OUTPUT_PATH = exports.REPO_DIR = void 0; const core = __importStar(__nccwpck_require__(2186)); exports.REPO_DIR = process.env.GITHUB_WORKSPACE; exports.OUTPUT_PATH = core.getInput('output-path'); @@ -30186,6 +30186,7 @@ exports.SBOM_INDENTIFY = core.getInput('sbom-identify'); exports.SBOM_IGNORE = core.getInput('sbom-ignore'); exports.API_KEY = core.getInput('api-key'); exports.API_URL = core.getInput('api-url'); +exports.WITH_DEPENDENCIES = core.getInput('with-dependencies'); /***/ }), @@ -30418,7 +30419,7 @@ function getLicensesTable(licenses) { let markdownTable = '| License | Copyleft | URL |\n'; markdownTable += '| ------- | -------- | --- |\n'; licenses.forEach(license => { - const copyleftIcon = license.copyleft ? ':heavy_check_mark:' : ':x:'; + const copyleftIcon = license.copyleft ? ':x:' : ' '; markdownTable += `| ${license.spdxid} | ${copyleftIcon} | ${license.url || ''} |\n`; }); return markdownTable; @@ -30568,8 +30569,8 @@ exports.commandBuilder = void 0; const input = __importStar(__nccwpck_require__(483)); function commandBuilder() { return `docker run -v "${input.REPO_DIR}":"/scanoss" ghcr.io/scanoss/scanoss-py:v1.9.0 scan . - --dependencies - --output ${input.OUTPUT_PATH} + --output ${input.OUTPUT_PATH} + ${input.WITH_DEPENDENCIES ? `--dependencies` : ''} ${input.SBOM_INDENTIFY ? `--identify ${input.SBOM_INDENTIFY}` : ''} ${input.SBOM_IGNORE ? `--ignore ${input.SBOM_IGNORE}` : ''} ${input.API_URL ? `--apiurl ${input.API_URL}` : ''} diff --git a/src/app.input.ts b/src/app.input.ts index 98c093a..de1536e 100644 --- a/src/app.input.ts +++ b/src/app.input.ts @@ -6,3 +6,4 @@ export const SBOM_INDENTIFY = core.getInput('sbom-identify'); export const SBOM_IGNORE = core.getInput('sbom-ignore'); export const API_KEY = core.getInput('api-key'); export const API_URL = core.getInput('api-url'); +export const WITH_DEPENDENCIES = core.getInput('with-dependencies'); diff --git a/src/services/report.service.ts b/src/services/report.service.ts index 836d407..27a43b5 100644 --- a/src/services/report.service.ts +++ b/src/services/report.service.ts @@ -6,7 +6,7 @@ export function getLicensesTable(licenses: Licenses[]): string { markdownTable += '| ------- | -------- | --- |\n'; licenses.forEach(license => { - const copyleftIcon = license.copyleft ? ':heavy_check_mark:' : ':x:'; + const copyleftIcon = license.copyleft ? ':x:' : ' '; markdownTable += `| ${license.spdxid} | ${copyleftIcon} | ${license.url || ''} |\n`; }); diff --git a/src/services/scan.service.ts b/src/services/scan.service.ts index 5cc03f5..f84f785 100644 --- a/src/services/scan.service.ts +++ b/src/services/scan.service.ts @@ -2,8 +2,8 @@ import * as input from '../app.input'; export function commandBuilder(): string { return `docker run -v "${input.REPO_DIR}":"/scanoss" ghcr.io/scanoss/scanoss-py:v1.9.0 scan . - --dependencies - --output ${input.OUTPUT_PATH} + --output ${input.OUTPUT_PATH} + ${input.WITH_DEPENDENCIES ? `--dependencies` : ''} ${input.SBOM_INDENTIFY ? `--identify ${input.SBOM_INDENTIFY}` : ''} ${input.SBOM_IGNORE ? `--ignore ${input.SBOM_IGNORE}` : ''} ${input.API_URL ? `--apiurl ${input.API_URL}` : ''}