Created
March 25, 2017 10:07
-
-
Save laurynas/451a7806aa4c0218055b7421da24a6be to your computer and use it in GitHub Desktop.
Bundler security audit rake task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run with `bundle:audit_and_notify` | |
require 'bundler/audit/task' | |
Bundler::Audit::Task.new | |
task default: 'bundle:audit' | |
namespace :bundle do | |
desc 'Audit and notify about gem vulnerabilities' | |
task audit_and_notify: :environment do | |
output = `rake bundle:audit` | |
unless $CHILD_STATUS.success? | |
Notifier.notify_admin('Bundle vulnerabilities found', output).deliver | |
end | |
puts output | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment