From 3729e8e87e28ac796560052b1eee5cac9d4c9424 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Sat, 25 Apr 2015 14:39:57 +0200 Subject: [PATCH] migliorata lettura dati --- scripts/github.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/github.coffee b/scripts/github.coffee index e7fc684..c03246f 100644 --- a/scripts/github.coffee +++ b/scripts/github.coffee @@ -3,6 +3,12 @@ module.exports = (robot) -> robot.router.post '/hubot/githubhook/:room', (req, res) -> - res.end 200 + res.send 200 console.log req.body robot.send req.params.room, JSON.stringify req.body + if req.body.ref is 'refs/head/master' + s = 'Sono stato aggiornato!\n' + cm = req.body.commits.map (c) -> + [c.committer.username,c.message].join ' -> ' + commits = cm.join '\n' + robot.send req.params.room, s+commits