2016-07-26 05:59:35 +08:00
|
|
|
# Ensure there is a summary for a pull request
|
2016-07-28 03:36:40 +08:00
|
|
|
fail 'Please provide a summary in the Pull Request description' if github.pr_body.length < 5
|
2016-07-26 05:59:35 +08:00
|
|
|
|
|
|
|
# Warn when there are merge commits in the diff
|
2016-07-28 03:36:40 +08:00
|
|
|
warn 'Please rebase to get rid of the merge commits in this Pull Request' if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ }
|
2016-07-26 05:59:35 +08:00
|
|
|
|
|
|
|
# Only one library per pull request
|
2016-08-12 23:50:00 +08:00
|
|
|
warn 'Too many changes (when adding, please keep it to one project per Pull Request)' if git.insertions > 1
|
2016-07-28 03:35:15 +08:00
|
|
|
|
2016-07-28 03:36:40 +08:00
|
|
|
# Warn if pull request is not updated
|
2016-08-05 13:16:06 +08:00
|
|
|
warn 'Please update the Pull Request title to contain the library name' if github.pr_title.include? 'Update README.md'
|
2016-08-02 06:29:04 +08:00
|
|
|
|
|
|
|
# Check links
|
|
|
|
require 'json'
|
2016-08-04 02:01:47 +08:00
|
|
|
results = File.read 'ab-results-README.md-markdown-table.json'
|
2016-08-02 06:29:04 +08:00
|
|
|
j = JSON.parse results
|
2016-08-04 02:01:47 +08:00
|
|
|
if j['error']==true
|
2017-07-06 00:21:57 +08:00
|
|
|
m = j['title']
|
2017-08-22 08:55:35 +08:00
|
|
|
m << ', a project collaborator will take care of these, thanks :)'
|
2017-07-06 00:21:57 +08:00
|
|
|
warn m
|
2016-08-04 02:01:47 +08:00
|
|
|
markdown j['message']
|
2016-08-02 06:29:04 +08:00
|
|
|
end
|