Skip to content

Commit 74a6074

Browse files
committed
Set json output
Set the "json" Action output instead of "report" to match what the documentation describes. Signed-off-by: Kevin Klopfenstein <[email protected]>
1 parent 9d425e6 commit 74a6074

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ async function runScan({ source, failBuild, severityCutoff, onlyFixed, outputFor
251251
case "json": {
252252
const REPORT_FILE = "./results.json";
253253
fs.writeFileSync(REPORT_FILE, cmdOutput);
254-
out.report = REPORT_FILE;
254+
out.json = REPORT_FILE;
255255
break;
256256
}
257257
default: // e.g. table

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ async function runScan({ source, failBuild, severityCutoff, onlyFixed, outputFor
237237
case "json": {
238238
const REPORT_FILE = "./results.json";
239239
fs.writeFileSync(REPORT_FILE, cmdOutput);
240-
out.report = REPORT_FILE;
240+
out.json = REPORT_FILE;
241241
break;
242242
}
243243
default: // e.g. table

tests/action_args.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const exec = require("@actions/exec");
55
jest.setTimeout(30000);
66

77
describe("Github action args", () => {
8-
it("runs without sarif report", async () => {
8+
it("runs with json report", async () => {
99
const inputs = {
1010
image: "",
1111
path: "tests/fixtures/npm-project",
@@ -36,6 +36,7 @@ describe("Github action args", () => {
3636
});
3737

3838
expect(outputs["sarif"]).toBeFalsy();
39+
expect(outputs["json"]).toBe("./results.json");
3940

4041
spyInput.mockRestore();
4142
spyOutput.mockRestore();

0 commit comments

Comments
 (0)