diff --git a/py/plugins/snyk.py b/py/plugins/snyk.py index f5715b9..35af4cd 100644 --- a/py/plugins/snyk.py +++ b/py/plugins/snyk.py @@ -170,7 +170,11 @@ def scan_hook(results, mock, props): mock.exec_chroot_cmd("/bin/rm -fv %s" % auth_token_dst) # check exit code of snyk code itself - if ec not in [0, 1]: + if ec == 3: + # If there are no supported project, we just return a successful scan without results + results.print_with_ts("snyk-code: no supported projects detected") + return 0 + elif ec not in [0, 1]: results.error("snyk code returned unexpected exit status: %d" % ec, ec=ec) # returning non-zero would prevent csmock from archiving SNYK_LOG