Fix payload parsing

This commit is contained in:
Basti 2017-05-13 16:36:48 +02:00
parent 8596483721
commit 7d8c6032c9

View File

@ -248,7 +248,7 @@ const Web3 = require('web3');
let data = req.body;
// For some reason data is contained in a payload property on one
// machine, but directly in the root of the object on others
if (data.payload) { data = data.payload; }
if (data.payload) { data = JSON.parse(data.payload); }
robot.logger.info(`Received GitHub hook. Event: ${evt}, action: ${data.action}`);