Improved compatibility with new hooks api

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 10 years ago
parent 9f793cb2f1
commit 5bc242a854
  1. 6
      BuildServer/routes/postreceive.js

@ -9,6 +9,12 @@ module.exports = function (req, res) {
return res.end(); return res.end();
} }
if (req.header("x-github-event") !== "push") {
console.log("Got '" + req.header("x-github-event") + "' event:");
//console.log(req.body);
return res.send("Only push events are supported");
}
var payload = req.body.payload ? JSON.parse(req.body.payload) : req.body, var payload = req.body.payload ? JSON.parse(req.body.payload) : req.body,
repository = payload.repository; repository = payload.repository;

Loading…
Cancel
Save