grep-tests-from-pull-requests
Advanced tools
Comparing version 1.8.2 to 1.8.3
{ | ||
"name": "grep-tests-from-pull-requests", | ||
"version": "1.8.2", | ||
"version": "1.8.3", | ||
"description": "Grabs the test tags to run from the pull request text", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -39,12 +39,18 @@ // @ts-check | ||
// @ts-ignore | ||
const res = await got.get(url, { | ||
headers: { | ||
authorization: `Bearer ${envOptions.token}`, | ||
accept: 'application/vnd.github.v3+json', | ||
}, | ||
}) | ||
try { | ||
// @ts-ignore | ||
const res = await got.get(url, { | ||
headers: { | ||
authorization: `Bearer ${envOptions.token}`, | ||
accept: 'application/vnd.github.v3+json', | ||
}, | ||
}) | ||
const json = JSON.parse(res.body) | ||
return json.body | ||
const json = JSON.parse(res.body) | ||
return json.body | ||
} catch (err) { | ||
console.error('Failed to fetch pull request %s', url) | ||
console.error(err.message) | ||
throw err | ||
} | ||
} | ||
@@ -84,14 +90,20 @@ | ||
// @ts-ignore | ||
const res = await got.get(url, { | ||
headers: { | ||
authorization: `Bearer ${envOptions.token}`, | ||
accept: 'application/vnd.github.v3+json', | ||
}, | ||
}) | ||
try { | ||
// @ts-ignore | ||
const res = await got.get(url, { | ||
headers: { | ||
authorization: `Bearer ${envOptions.token}`, | ||
accept: 'application/vnd.github.v3+json', | ||
}, | ||
}) | ||
const comments = JSON.parse(res.body) | ||
debug('found %d comments for PR %d', comments.length, options.pull) | ||
// each comment in the array is an object with a body property | ||
return comments | ||
const comments = JSON.parse(res.body) | ||
debug('found %d comments for PR %d', comments.length, options.pull) | ||
// each comment in the array is an object with a body property | ||
return comments | ||
} catch (err) { | ||
console.error('Failed to fetch pull request comments %s', url) | ||
console.error(err.message) | ||
throw err | ||
} | ||
} | ||
@@ -98,0 +110,0 @@ |
22062
499