Description
It is a bit too easy for a developer to accidentally misconfigure the --gemfile-lock option and think their Gemfile.lock has no vulnerabilities. For example if they use Gemfile instead of their Gemfile.lock which has vulnerabilities, the bundle-audit command returns with exit code 0 and does not report it has been given an invalid lock file.
Steps To Reproduce
Steps to reproduce the bug:
# Command exits successfully, when Gemfile is accidentally given
# instead of the Gemfile.lock which has vulnerable gems:
bundle-audit check --gemfile-lock Gemfile
# => No vulnerabilities found
bundle-audit check --gemfile-lock Gemfile.lock
# => Vulnerabilities found!
# Giving any file other than the lock file, command exits successfully:
bundle-audit check --gemfile-lock README.md
# => No vulnerabilities found
Expected Behavior
Command should exit with non-zero exit code, and an appropriate message output saying invalid lock file given.
Environment
$ bundler-audit --version
bundler-audit 0.9.2
$ bundle --version
Bundler version 2.5.22
$ ruby --version
3.3.8
Description
It is a bit too easy for a developer to accidentally misconfigure the
--gemfile-lockoption and think theirGemfile.lockhas no vulnerabilities. For example if they useGemfileinstead of theirGemfile.lockwhich has vulnerabilities, thebundle-auditcommand returns with exit code0and does not report it has been given an invalid lock file.Steps To Reproduce
Steps to reproduce the bug:
Expected Behavior
Command should exit with non-zero exit code, and an appropriate message output saying invalid lock file given.
Environment