fixed github integration
This commit is contained in:
parent
3729e8e87e
commit
482ddc7c57
@ -5,4 +5,4 @@ set -e
|
||||
PYTHON=python2 npm install
|
||||
export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH"
|
||||
|
||||
DEBUG=nightmare PYTHON=python2 BIND_ADDRESS=localhost node_modules/.bin/hubot --name "asjon" --alias "assa" "$@"
|
||||
DEBUG=nightmare PYTHON=python2 node_modules/.bin/hubot --name "asjon" --alias "assa" "$@"
|
||||
|
@ -4,6 +4,13 @@
|
||||
module.exports = (robot) ->
|
||||
robot.router.post '/hubot/githubhook/:room', (req, res) ->
|
||||
res.send 200
|
||||
if !process.env.GITHUB_API_SECRET
|
||||
console.log 'non sono configurato per GITHUB API WEBHOOKS!'
|
||||
return
|
||||
else if process.env.GITHUB_API_SECRET isnt req.headers["X-Hub-Signature"]
|
||||
console.log 'MALFORMED GITHUB API SECRET: was',
|
||||
req.headers["X-Hub-Signature"], 'but expected', process.env.GITHUB_API_SECRET
|
||||
return
|
||||
console.log req.body
|
||||
robot.send req.params.room, JSON.stringify req.body
|
||||
if req.body.ref is 'refs/head/master'
|
||||
|
Loading…
Reference in New Issue
Block a user