Skip to content

Commit

Permalink
snyk: do not throw away Snyk results by mistake
Browse files Browse the repository at this point in the history
... on successful scans.  This commit fixes a major regression
introduced by the previous commit.

Fixes: commit e886342
Related: https://issues.redhat.com/browse/OSH-329
Resolves: https://issues.redhat.com/browse/OSH-362
Closes: #133
  • Loading branch information
kdudka committed Oct 19, 2023
1 parent e886342 commit e1a73c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py/plugins/snyk.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ def scan_hook(results, mock, props):

# convert the results into the csdiff's JSON format
def filter_hook(results):
# If no supported project is found, we don't have results file
if not os.path.exists(SNYK_OUTPUT):
return 0
src = results.dbgdir_raw + SNYK_OUTPUT
if not os.path.exists(src):
# do not convert SARIF results if they were not provided by Snyk
return 0
dst = "%s/snyk-capture.js" % results.dbgdir_uni
cmd = FILTER_CMD % (src, dst)
return results.exec_cmd(cmd, shell=True)
Expand Down

0 comments on commit e1a73c6

Please sign in to comment.