diff --git a/scripts/github-deploy.coffee b/scripts/github-deploy.coffee index 3fefc80..7687c72 100644 --- a/scripts/github-deploy.coffee +++ b/scripts/github-deploy.coffee @@ -13,9 +13,6 @@ module.exports = (robot) -> robot.brain.data.deploys ||= [] github = require("githubot") - github.handleErrors (response) -> - msg.send "An error occurred: #{response.statusCode} | #{response.error} | #{response.body}" - addDeploy = (repoName) -> robot.brain.data.deploys.push(repoName) robot.brain.data.deploys = _.uniq(robot.brain.data.deploys) @@ -53,6 +50,9 @@ module.exports = (robot) -> client = github(robot, options) + client.handleErrors (response) -> + msg.send "An error occurred: #{response.error}" + client.post "repos/dobtco/#{repoName}/pulls", title: 'Deploy to production' head: 'master'