From 724cc32be3946b12695b03e7fbdce1b8fc00fdb3 Mon Sep 17 00:00:00 2001 From: Rahul Gandhi Date: Mon, 28 Aug 2017 12:24:04 +0530 Subject: [PATCH] Support for Github enterprise URLs --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 50f3ae7..47d9d73 100644 --- a/index.js +++ b/index.js @@ -12,10 +12,12 @@ class Build { error (message, url) {return update(this.meta, message, url, 'error')} } +const default_git_url = "https://api.github.com" + const update = (build, message, url, status) => new Promise((resolve, reject) => { axios({ method: 'POST', - url: `https://api.github.com/repos/${build.repo}/statuses/${build.sha}`, + url: `${build.ghe ? `${build.ghe}/api/v3` : default_git_url }/repos/${build.repo}/statuses/${build.sha}`, responseType: 'json', data: { state: status,