Skip to content

Commit

Permalink
Add Danger check against merge commits
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelofabri committed Aug 14, 2017
1 parent 442df0d commit 491693f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ require 'open3'
# Warn when there is a big PR
warn('Big PR') if git.lines_of_code > 500

# Ensure a clean commits history
if git.commits.any? { |c| c.message =~ /^Merge branch '#{github.branch_for_base}'/ }
fail('Please rebase to get rid of the merge commits in this PR')
end

modified_files = git.modified_files + git.added_files

# Sometimes its a README fix, or something like that - which isn't relevant for
Expand Down

0 comments on commit 491693f

Please sign in to comment.