Skip to content

Commit

Permalink
run danger when Gemfile or build-related files are updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsim committed May 19, 2017
1 parent 89174fd commit a09e987
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ warn('Big PR') if git.lines_of_code > 500
# including in a CHANGELOG for example
has_app_changes = !git.modified_files.grep(/Source/).empty?
has_test_changes = !git.modified_files.grep(/Tests/).empty?
has_danger_changes = !git.modified_files.grep(/Dangerfile|script\/oss-check/).empty?
has_danger_changes = !git.modified_files.grep(/Dangerfile|script\/oss-check|Gemfile/).empty?
has_build_changes = !git.modified_files.grep(/Makefile|SwiftLint\.xcodeproj|SwiftLint\.xcworkspace|Package\.swift|Cartfile/).empty?

# Add a CHANGELOG entry for app changes
if !git.modified_files.include?('CHANGELOG.md') && has_app_changes
Expand All @@ -29,7 +30,7 @@ if git.lines_of_code > 50 && has_app_changes && !has_test_changes
end

# Run OSSCheck if there were app changes
if has_app_changes || has_danger_changes
if has_app_changes || has_danger_changes || has_build_changes
def non_empty_lines(lines)
lines.split(/\n+/).reject(&:empty?)
end
Expand Down

0 comments on commit a09e987

Please sign in to comment.