Here are a few steps you can take to troubleshoot and fix the issue:
1. Verify the snyk test --json Output Ensure that the snyk test --json command is actually generating valid vulnerability data. You can test this separately by running the following command manually in your environment.
2. Verify Project Has Vulnerabilities You can ensure the proper setup of Snyk on your project by reviewing the following:
Make sure the correct package manager is being used (e.g., npm, yarn, etc.). Verify the project is being properly initialized and contains dependencies that can be analyzed by Snyk.
3. Ensure Proper Snyk Test Execution It’s possible that the snyk test is failing due to misconfiguration. You can try adjusting the snyk test command to include more verbose output for debugging.
4. Check if snyk-delta Is Receiving Valid Input Make sure that: a. baselineOrg and baselineProject are the correct IDs for your organization and project. b. The project already exists in Snyk with baseline vulnerability data.
5. Review Snyk and Snyk-Delta Versions It's possible that you may be using incompatible versions of snyk or snyk-delta. Ensure both are up to date.
6. Adjust the Workflow Your workflow should ensure that the snyk test command is executed successfully and produces valid JSON output before passing it to snyk-delta. You might need to add checks in your pipeline to handle cases where no vulnerabilities are found.
Additional Considerations: Snyk API Configuration: Ensure that the Snyk API is correctly configured, with the right access and project IDs. Snyk-Delta Compatibility: If you still experience issues, check the compatibility and requirements for snyk-delta with your version of snyk.