gitlab-org--gitlab-foss/lib/tasks/gitlab_danger.rake
Ash McKenzie 9fc9ab2ba2 Add new GitlabDanger class
This class encapsulates our use of the Danger gem.
2019-09-06 11:21:53 +00:00

17 lines
388 B
Ruby

desc 'Run local Danger rules'
task :danger_local do
require 'gitlab_danger'
require 'gitlab/popen'
puts("#{GitlabDanger.local_warning_message}\n")
# _status will _always_ be 0, regardless of failure or success :(
output, _status = Gitlab::Popen.popen(%w{danger dry_run})
if output.empty?
puts(GitlabDanger.success_message)
else
puts(output)
exit(1)
end
end