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

Load command ignores files with names different from .snyk #129

Open
valerio-castelli opened this issue Aug 1, 2023 · 0 comments
Open

Comments

@valerio-castelli
Copy link

  • node -v: v16.14.2
  • npm -v: 8.5.5
  • Command run: snyk test --policy-path='custom-file.yml'

Expected behaviour

The test command uses the content of custom-file.yml as policy.

Actual behaviour

The test command ignores the content of custom-file.yml and runs as if no policy file has been supplied.

Steps to reproduce

  1. Create a valid Snyk policy file with a name other than .snyk (like custom-file.yml)
  2. Run snyk test using the --policy-path option to point to the created policy file

This may be related to this line of code in policy.ts, and similar lines in the same file (here, here). The load method is invoked by the CLI here, and the policy-path is passed as an argument via policyLocations.

It seems that the code expects the file to be called .snyk. This contradicts the README, which states:

The policy is loaded, typically this will be a YAML file named .snyk (but can be loaded from another filename).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant