Skip to content

Commit

Permalink
Merge pull request #2 from iceskyl/add-audit-options
Browse files Browse the repository at this point in the history
feat: add audit options
  • Loading branch information
rainchen authored Jul 26, 2019
2 parents b0fba19 + 904d6ec commit 73f48ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ output example:

![](doc/imgs/code_quality_security_audit_failed_example.png)

#### options for security_audit:

```
# e.g.: code_quality security_audit bundler_audit_options="--ignore CVE-2015-9284"
# options:
# bundler_audit_options: pass extract options, e.g.: bundler_audit_options="--ignore CVE-2015-9284 --verbose"
```

#### work with CI

Expand Down
4 changes: 3 additions & 1 deletion lib/tasks/code_quality.rake
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ namespace :code_quality do

desc "bundler audit"
task :bundler_audit => :prepare do |task|
options = options_from_env(:bundler_audit_options)

run_audit task, "bundler audit - checks for vulnerable versions of gems in Gemfile.lock" do
# Update the ruby-advisory-db and check Gemfile.lock
report = `bundle audit check --update`
report = `bundle audit check --update #{options[:bundler_audit_options]}`
@report_path = "#{report_dir}/bundler-audit-report.txt"
File.open(@report_path, 'w') {|f| f.write report }
puts report
Expand Down

0 comments on commit 73f48ee

Please sign in to comment.