From a48c693fa1ec3bae668ec8cbfaffbdcaeb43c350 Mon Sep 17 00:00:00 2001 From: Allan <62227321+allgeo@users.noreply.github.com> Date: Thu, 4 Apr 2024 14:18:00 -0400 Subject: [PATCH] test --- src/main.ts | 15 ++++++++------- src/wait.ts | 14 -------------- 2 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 src/wait.ts diff --git a/src/main.ts b/src/main.ts index 3206f18..507fcea 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,13 +21,13 @@ export async function runSastScan(): Promise { const authToken = core.getInput('contrast-auth-token') //Set environment variables - process.env['CONTRAST__API__URL'] = apiUrl - process.env['CONTRAST__API__API_KEY'] = apiKey - process.env['CONTRAST__API__SERVICE_KEY'] = serviceKey - process.env['CONTRAST__API__ORGANIZATION'] = organization - process.env['CONTRAST__AUTH__TOKEN'] = authToken - process.env['CONTRAST__API__USER_NAME'] = userName - process.env['CONTRAST_RESOURCE_GROUP'] = resourceGroup + // process.env['CONTRAST__API__URL'] = apiUrl + // process.env['CONTRAST__API__API_KEY'] = apiKey + // process.env['CONTRAST__API__SERVICE_KEY'] = serviceKey + // process.env['CONTRAST__API__ORGANIZATION'] = organization + // process.env['CONTRAST__AUTH__TOKEN'] = authToken + // process.env['CONTRAST__API__USER_NAME'] = userName + // process.env['CONTRAST_RESOURCE_GROUP'] = resourceGroup //Download the scanner from JFrog Artifactory core.info('Downloading SAST scanner...') @@ -38,6 +38,7 @@ export async function runSastScan(): Promise { //Run the SAST scan core.info('Running SAST scan...') const scanCommand = `java -jar scanner.jar ${fileToBeScanned} --project-name ${projectName} --label ${userName} -r "${resourceGroup}"` + const { stdout, stderr } = await execAsync(scanCommand) if (stderr) { diff --git a/src/wait.ts b/src/wait.ts deleted file mode 100644 index 0ddf692..0000000 --- a/src/wait.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Wait for a number of milliseconds. - * @param milliseconds The number of milliseconds to wait. - * @returns {Promise} Resolves with 'done!' after the wait is over. - */ -export async function wait(milliseconds: number): Promise { - return new Promise(resolve => { - if (isNaN(milliseconds)) { - throw new Error('milliseconds not a number') - } - - setTimeout(() => resolve('done!'), milliseconds) - }) -}