Update Dangerfile

This commit is contained in:
n8225 2016-12-04 09:57:56 -06:00 committed by GitHub
parent f606bfb558
commit 1fe52b4236

View File

@ -1,3 +1,5 @@
#Check for changes to README.md
has_readme_changes = !git.modified_files.grep(/README.md).empty?
# Ensure there is a summary for a pull request # Ensure there is a summary for a pull request
fail 'Please provide a summary in the Pull Request description' if github.pr_body.length < 5 fail 'Please provide a summary in the Pull Request description' if github.pr_body.length < 5
@ -9,7 +11,7 @@ warn 'Please update the Pull Request title to contain the script name' if github
warn 'Please rebase to get rid of the merge commits in this Pull Request' if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ } warn 'Please rebase to get rid of the merge commits in this Pull Request' if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ }
# Check links # Check links
if [ -a ab-results-README.md-markdown-table.json ] if has_readme_changes
require 'json' require 'json'
results = File.read 'ab-results-README.md-markdown-table.json' results = File.read 'ab-results-README.md-markdown-table.json'
j = JSON.parse results j = JSON.parse results
@ -20,7 +22,7 @@ if [ -a ab-results-README.md-markdown-table.json ]
end end
# Check syntax # Check syntax
if [ -a syntaxcheck.json ] if has_readme_changes
require 'json' require 'json'
results = File.read 'syntaxcheck.json' results = File.read 'syntaxcheck.json'
j = JSON.parse results j = JSON.parse results