Skip to content
Browse files

hubot should only yell on broken builds

and be more informative in messages send. Like offering some links to gh and travis
  • Loading branch information...
1 parent ef1dfc2 commit fbb19bcc293e06e5fc8c9542de5ce7259f5a5903 @nesQuick nesQuick committed Aug 24, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/scripts/travis.coffee
View
7 src/scripts/travis.coffee
@@ -3,7 +3,7 @@
# Can also notify about builds, just enable the webhook notification on travis http://about.travis-ci.org/docs/user/build-configuration/ -> 'Webhook notification'
#
# Dependencies:
-# None
+# "gitio": "1.0.1"
#
# Configuration:
# None
@@ -20,6 +20,7 @@
url = require('url')
querystring = require('querystring')
+gitio = require('gitio')
module.exports = (robot) ->
@@ -43,4 +44,6 @@ module.exports = (robot) ->
payload = JSON.parse req.body.payload
- robot.send user, "#{payload.author_name} triggered build of #{payload.repository.name} and it #{payload.status_message}!"
+ if payload.status isnt 0
+ gitio payload.compare_url, (err, data) ->
+ robot.send user, "#{payload.author_name} broke the build (#{payload.build_url}) of #{payload.repository.name} with commit (#{if err then payload.compare_url else data})!"

0 comments on commit fbb19bc

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