Mirror of Awesome Self Hosted
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
988 B

8 years ago
8 years ago
8 years ago
  1. #Check for changes to README.md
  2. has_readme_changes = !git.modified_files.grep(/README.md).empty?
  3. # Ensure there is a summary for a pull request
  4. fail 'Please provide a summary in the Pull Request description' if github.pr_body.length < 5
  5. # Warn if pull request is not updated
  6. warn 'Please update the Pull Request title to contain the script name' if github.pr_title.include? 'Update README.md'
  7. # Warn when there are merge commits in the diff
  8. warn 'Please rebase to get rid of the merge commits in this Pull Request' if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ }
  9. # Check links
  10. if has_readme_changes
  11. require 'json'
  12. results = File.read 'ab-results-README.md-markdown-table.json'
  13. j = JSON.parse results
  14. if j['error']==true
  15. fail j['title']
  16. markdown j['message']
  17. end
  18. end
  19. # Check syntax
  20. if has_readme_changes
  21. require 'json'
  22. results = File.read 'syntaxcheck.json'
  23. j = JSON.parse results
  24. if j['error']==true
  25. fail j['title']
  26. markdown j['message']
  27. end
  28. end