Skip to content

Commit f910b2a

Browse files
authored
Merge pull request #14 from veracode/noGraphs
adding no graphs option
2 parents f944fd0 + c4dc798 commit f910b2a

File tree

8 files changed

+21
-4
lines changed

8 files changed

+21
-4
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ __Optional__ - run the Veracode SCA scan with `--skip-vms`
7575

7676
Default Value: __false__
7777

78+
### `no-graphs`
79+
__Optional__ - do not include dependency graphs in the JSON output.
80+
81+
Default Value: __false__
82+
7883
## Examples
7984

8085
### Scan your repository with textual output

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ inputs:
4949
description: "Run the SRCCLR with the `--skip-vms` option"
5050
required: false
5151
default: "false"
52+
no-graphs:
53+
description: "Run the SRCCLR with the `--no-graphs` option"
54+
required: false
55+
default: "false"
5256
runs:
5357
using: 'node16'
5458
main: 'dist/index.js'

dist/index.js

100755100644
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17562,6 +17562,7 @@ const options = {
1756217562
path: core.getInput('path', { trimWhitespace: true }) || '.',
1756317563
debug: core.getBooleanInput('debug'),
1756417564
"skip-vms": core.getBooleanInput('skip-vms'),
17565+
"no-graphs": core.getBooleanInput('no-graphs'),
1756517566
recursive: core.getBooleanInput('recursive'),
1756617567
"skip-collectors": core.getInput('skip-collectors').split(',')
1756717568
};
@@ -18113,9 +18114,10 @@ function runAction(options) {
1811318114
if (skip.length > 0) {
1811418115
skipCollectorsAttr = `--skip-collectors ${skip.toString()} `;
1811518116
}
18117+
const noGraphs = options["no-graphs"];
1811618118
const skipVMS = options["skip-vms"];
1811718119
const commandOutput = options.createIssues ? `--json=${index_1.SCA_OUTPUT_FILE}` : '';
18118-
extraCommands = `${extraCommands}${options.recursive ? '--recursive ' : ''}${options.quick ? '--quick ' : ''}${options.allowDirty ? '--allow-dirty ' : ''}${options.updateAdvisor ? '--update-advisor ' : ''}${skipVMS ? '--skip-vms ' : ''}${options.debug ? '--debug ' : ''}${skipCollectorsAttr}`;
18120+
extraCommands = `${extraCommands}${options.recursive ? '--recursive ' : ''}${options.quick ? '--quick ' : ''}${options.allowDirty ? '--allow-dirty ' : ''}${options.updateAdvisor ? '--update-advisor ' : ''}${skipVMS ? '--skip-vms ' : ''}${noGraphs ? '--no-graphs ' : ''}${options.debug ? '--debug ' : ''}${skipCollectorsAttr}`;
1811918121
const command = `curl -sSL https://download.sourceclear.com/ci.sh | sh -s -- scan ${extraCommands} ${commandOutput}`;
1812018122
core.info(command);
1812118123
if (options.createIssues) {

src/action.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const options: Options = {
1616
path: core.getInput('path',{trimWhitespace: true}) || '.',
1717
debug: core.getBooleanInput('debug'),
1818
"skip-vms": core.getBooleanInput('skip-vms'),
19+
"no-graphs": core.getBooleanInput('no-graphs'),
1920
recursive: core.getBooleanInput('recursive'),
2021
"skip-collectors": core.getInput('skip-collectors').split(',')
2122

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import * as core from '@actions/core'
99
const { request } = require('@octokit/request');
1010
const github = require('@actions/github');
1111

12-
1312
export const SCA_OUTPUT_FILE = 'scaResults.json';
1413

1514
const librariesWithIssues:any = {};

src/options.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ export interface Options {
1111
allowDirty:boolean,
1212
recursive:boolean,
1313
"skip-vms":boolean,
14+
"no-graphs":boolean,
1415
"skip-collectors": Array<string>
1516
}
17+
18+

src/srcclr.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ export async function runAction (options: Options) {
3535
if (skip.length>0) {
3636
skipCollectorsAttr = `--skip-collectors ${skip.toString()} `;
3737
}
38+
39+
const noGraphs = options["no-graphs"]
3840
const skipVMS = options["skip-vms"]
3941

4042
const commandOutput = options.createIssues ? `--json=${SCA_OUTPUT_FILE}` : '';
41-
extraCommands = `${extraCommands}${options.recursive?'--recursive ':''}${options.quick? '--quick ':''}${options.allowDirty? '--allow-dirty ':''}${options.updateAdvisor? '--update-advisor ':''}${skipVMS? '--skip-vms ':''}${options.debug? '--debug ':''}${skipCollectorsAttr}`;
43+
extraCommands = `${extraCommands}${options.recursive?'--recursive ':''}${options.quick? '--quick ':''}${options.allowDirty? '--allow-dirty ':''}${options.updateAdvisor? '--update-advisor ':''}${skipVMS? '--skip-vms ':''}${noGraphs? '--no-graphs ':''}${options.debug? '--debug ':''}${skipCollectorsAttr}`;
4244
const command = `curl -sSL https://download.sourceclear.com/ci.sh | sh -s -- scan ${extraCommands} ${commandOutput}`;
4345
core.info(command);
4446

src/test/testRun.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const options: Options = {
1616
"skip-collectors": [],
1717
allowDirty: false,
1818
recursive:false,
19-
"skip-vms":false
19+
"skip-vms":false,
20+
"no-graphs":false
2021
}
2122

2223
runAction(options);

0 commit comments

Comments
 (0)