Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error finding results when output-name specified #96

Open
lewis-shell opened this issue Aug 14, 2023 · 3 comments · May be fixed by #106
Open

Error finding results when output-name specified #96

lewis-shell opened this issue Aug 14, 2023 · 3 comments · May be fixed by #106
Labels
bug Something isn't working

Comments

@lewis-shell
Copy link

When the output-name parameter is set to anything other than "results" (e.g. using a config file), the action still looks for a file called results.json, which then causes an error to be logged in the console

To reproduce

kics-config.json:

{
  "output-name": "my-results"
}

Workflow file:

      - name: "Scan with KICS"
        uses: checkmarx/[email protected]
        with:
          path: "."
          config_path: kics-config.json
          platform_type: terraform
          output_path: kics-results
          output_formats: "json,sarif"

Error message:

Running KICS action...
Error: ENOENT: no such file or directory, open 'kics-results/results.json'
    at Object.openSync (node:fs:603:3)
    at Object.readFileSync (node:fs:471:35)
    at readJSON (/app/dist/index.js:16785:24)
    at main (/app/dist/index.js:16854:31)
    at /app/dist/index.js:16872:1
    at /app/dist/index.js:16874:3
    at Object.<anonymous> (/app/dist/index.js:16877:12)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: 'kics-results/results.json'
}
@kaplanlior kaplanlior added the bug Something isn't working label Aug 14, 2023
@kaplanlior
Copy link

Adding the code reference which has results.json hardcoded since the github action doesn't read output-name variable.

function processOutputPath(output) {

@toestreich
Copy link

toestreich commented Sep 19, 2023

Im having the same issue - have you found a solution?

@cxMiguelSilva
Copy link
Collaborator

Hi @toestreich and @lewis-shell,
I am glad to let you know that this issue is being addressed on the #106.
Now the KICS GitHub action will take into account the output name set on the config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants