Skip to content
Browse files

No more commit-floods on merges.

  • Loading branch information...
1 parent 6783f77 commit 812a5233a10316c965cfb3b450b7335c8870e720 @defunkt defunkt committed Feb 9, 2009
Showing with 8 additions and 1 deletion.
  1. +8 −1 services/campfire.rb
View
9 services/campfire.rb
@@ -6,9 +6,16 @@
throw(:halt, 400) unless campfire && campfire.login(data['email'], data['password'])
throw(:halt, 400) unless room = campfire.find_room_by_name(data['room'])
- payload['commits'].each do |commit|
+ if payload['commits'].last && payload['commits'].last['message'] =~ /^Merge/
+ commits = payload['commits'][-1, 1]
+ else
+ commits = payload['commits']
+ end
+
+ commits.each do |commit|
room.speak "[#{repository}/#{branch}] #{commit['message']} - #{commit['author']['name']} (#{commit['url']})"
end
+
room.leave
campfire.logout
end

0 comments on commit 812a523

Please sign in to comment.
Something went wrong with that request. Please try again.