diff --git a/dist/index.js b/dist/index.js index 340fa0a8..6e33f70e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -251,7 +251,7 @@ async function runScan({ source, failBuild, severityCutoff, onlyFixed, outputFor case "json": { const REPORT_FILE = "./results.json"; fs.writeFileSync(REPORT_FILE, cmdOutput); - out.report = REPORT_FILE; + out.json = REPORT_FILE; break; } default: // e.g. table diff --git a/index.js b/index.js index 62c283c0..44da0c9b 100644 --- a/index.js +++ b/index.js @@ -237,7 +237,7 @@ async function runScan({ source, failBuild, severityCutoff, onlyFixed, outputFor case "json": { const REPORT_FILE = "./results.json"; fs.writeFileSync(REPORT_FILE, cmdOutput); - out.report = REPORT_FILE; + out.json = REPORT_FILE; break; } default: // e.g. table diff --git a/tests/action_args.test.js b/tests/action_args.test.js index 84278d57..511ccbc6 100644 --- a/tests/action_args.test.js +++ b/tests/action_args.test.js @@ -5,7 +5,7 @@ const exec = require("@actions/exec"); jest.setTimeout(30000); describe("Github action args", () => { - it("runs without sarif report", async () => { + it("runs with json report", async () => { const inputs = { image: "", path: "tests/fixtures/npm-project", @@ -36,6 +36,7 @@ describe("Github action args", () => { }); expect(outputs["sarif"]).toBeFalsy(); + expect(outputs["json"]).toBe("./results.json"); spyInput.mockRestore(); spyOutput.mockRestore();