fix: catch GItHub API call rejections

ref: issue #51
This commit is contained in:
Federico Grandi
2020-08-11 22:17:04 +02:00
parent 4e2f1656df
commit 6f5455c37d

View File

@@ -32,7 +32,13 @@ async function checkInputs() {
headers = process.env.GITHUB_TOKEN ? {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`
} : undefined,
commit = (await axios.get(url, { headers })).data
commit = (await axios.get(url, { headers }).catch(err => {
info('::group::Request error:')
info(`Request URL: ${url}`)
info(err)
info('::endgroup::')
return undefined
}))?.data
author = commit?.commit?.author
}