lib/tutter/action/sppuppet.rb in tutter-sppuppet-0.0.7 vs lib/tutter/action/sppuppet.rb in tutter-sppuppet-0.0.8
- old
+ new
@@ -15,11 +15,11 @@
def run
# If a new pull request is opened, comment with instructions
if @data['action'] == 'opened' && @settings['post_instructions']
issue = @data['number']
- comment = @settings['instructions'] || "To merge at least #{@settings['plus_ones_required']} person other than the submitter needs to write a comment with saying _+1_ or _:+1:_. Then write _!merge_ to trigger the merging."
+ comment = @settings['instructions'] || "To merge at least #{@settings['plus_ones_required']} person other than the submitter needs to write a comment with saying _+1_ or :+1:. Then write _!merge_ or :shipit: to trigger the merging."
begin
@client.add_comment(@project, issue, comment)
return 200, "Commented!"
rescue Octokit::NotFound
return 404, "Octokit returned 404, this could be an issue with your access token"
@@ -76,10 +76,10 @@
if /^(\-1|:\-1:)/.match i.body
return 200, "#{@project} #{pull_request_id} has a -1. I will not take the blame"
end
end
- merge = true if comments.last.body == '!merge'
+ merge = comments.last.body == '!merge' || comments.last.body == ':shipit:'
if plus_one.count >= @settings['plus_ones_required'] and merge
@client.merge_pull_request(@project, pull_request_id, 'SHIPPING!!')
return 200, "merging #{pull_request_id} #{@project}"
elsif plus_one.count >= @settings['plus_ones_required']