diff --git a/action.yml b/action.yml index 8a7f695..3f637ea 100644 --- a/action.yml +++ b/action.yml @@ -30,6 +30,14 @@ inputs: detect-trust-cert: description: 'Acceptable Values: TRUE, FALSE. If TRUE, Detect will trust the Black Duck certificate even if the certificate is not in the keystore.' default: 'TRUE' + detect-binary-repo-url: + description: 'Repository which the detect binary will be obtained from' + default: 'https://sig-repo.synopsys.com' + required: false + detect-binary-repo-path: + description: 'Path in the repository where the detect binary versions are located' + default: 'bds-integrations-release/com/synopsys/integration/synopsys-detect' + required: false runs: using: 'node12' main: 'dist/index.js' diff --git a/src/detect/detect-manager.ts b/src/detect/detect-manager.ts index 46848f4..78e3a44 100644 --- a/src/detect/detect-manager.ts +++ b/src/detect/detect-manager.ts @@ -1,9 +1,8 @@ import { find, downloadTool, cacheFile } from '@actions/tool-cache' import { exec } from '@actions/exec' import path from 'path' -import { DETECT_VERSION } from '../inputs' +import { DETECT_VERSION, DETECT_BINARY_REPO_URL, DETECT_BINARY_REPO_PATH } from '../inputs' -const DETECT_BINARY_REPO_URL = 'https://sig-repo.synopsys.com' export const TOOL_NAME = 'detect' export async function findOrDownloadDetect(): Promise { @@ -29,5 +28,5 @@ export async function runDetect(detectPath: string, detectArguments: string[]): } function createDetectDownloadUrl(repoUrl = DETECT_BINARY_REPO_URL): string { - return `${repoUrl}/bds-integrations-release/com/synopsys/integration/synopsys-detect/${DETECT_VERSION}/synopsys-detect-${DETECT_VERSION}.jar` + return `${repoUrl}/${DETECT_BINARY_REPO_PATH}/${DETECT_VERSION}/synopsys-detect-${DETECT_VERSION}.jar` } diff --git a/src/inputs.ts b/src/inputs.ts index 508bf42..190518c 100644 --- a/src/inputs.ts +++ b/src/inputs.ts @@ -8,3 +8,5 @@ export const SCAN_MODE = getInput('scan-mode').toUpperCase() export const FAIL_ON_ALL_POLICY_SEVERITIES = getBooleanInput('fail-on-all-policy-severities') export const OUTPUT_PATH_OVERRIDE = getInput('output-path-override') export const DETECT_TRUST_CERT = getInput('detect-trust-cert') +export const DETECT_BINARY_REPO_URL = getInput('detect-binary-repo-url') +export const DETECT_BINARY_REPO_PATH = getInput('detect-binary-repo-path')