Skip to content

Commit 406e72a

Browse files
authored
Supporting running client with --tool (#17)
Supporting running client with --tools (#17)
1 parent 973e821 commit 406e72a

File tree

6 files changed

+264
-4
lines changed

6 files changed

+264
-4
lines changed

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ inputs:
1414
description: A comma separated list of analyzer categories to run. Values secrets, code, artifacts, IaC, containers. Example IaC,secrets. Defaults to all.
1515
languages:
1616
description: A comma separated list of languages to analyze. Example javascript, typescript. Defaults to all.
17+
tools:
18+
description: A comma separated list of analyzer tools to run. Example bandit, binskim, eslint, template-analyzer, terrascan, trivy.
1719
outputs:
1820
sarifFile:
1921
description: A file path to a SARIF results file.

lib/action.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ function run() {
6767
}
6868
}
6969
}
70+
let toolsString = core.getInput('tools');
71+
if (!client.isNullOrWhiteSpace(toolsString)) {
72+
let tools = toolsString.split(',');
73+
args.push('--tool');
74+
for (let i = 0; i < tools.length; i++) {
75+
let tool = tools[i];
76+
if (!client.isNullOrWhiteSpace(tool)) {
77+
args.push(tool.trim());
78+
}
79+
}
80+
}
7081
args.push('--github');
7182
yield client.run(args, 'microsoft/security-devops-action');
7283
});

node_modules/.package-lock.json

Lines changed: 236 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "microsoft-security-devops-action",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"description": "Node dependencies for the microsoft/security-devops-action.",
55
"scripts": {
66
"test": "mocha"

src/action.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ async function run() {
4545
}
4646
}
4747

48+
let toolsString: string = core.getInput('tools');
49+
if (!client.isNullOrWhiteSpace(toolsString)) {
50+
let tools = toolsString.split(',');
51+
args.push('--tool');
52+
for (let i = 0; i < tools.length; i++) {
53+
let tool = tools[i];
54+
if (!client.isNullOrWhiteSpace(tool)) {
55+
args.push(tool.trim());
56+
}
57+
}
58+
}
59+
4860
args.push('--github');
4961

5062
await client.run(args, 'microsoft/security-devops-action');

0 commit comments

Comments
 (0)