bitbucket-eslint-bot
Advanced tools
Comparing version 1.1.1 to 1.1.2
14
index.js
@@ -49,6 +49,10 @@ const fetch = require("node-fetch"); | ||
.then(r => { | ||
if (r.ok) return r.json(); | ||
if (r.ok) { | ||
return r.json(); | ||
} else { | ||
throw { url: r.url, status: r.status, statusText: r.statusText }; | ||
} | ||
}) | ||
.then(response => { | ||
if (options.createTask) | ||
if (options.createTask && errors > 0) | ||
return fetch(`${bitbucketUrl}/rest/api/1.0/tasks`, { | ||
@@ -69,3 +73,7 @@ method: "POST", | ||
}).then(r => { | ||
if (r.ok) return r.json(); | ||
if (r.ok) { | ||
return r.json(); | ||
} else { | ||
throw { url: r.url, status: r.status, statusText: r.statusText }; | ||
} | ||
}); | ||
@@ -72,0 +80,0 @@ }) |
{ | ||
"name": "bitbucket-eslint-bot", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Bot to run on CI to post eslint errors on Bitbucket PRs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
8721
203