Skip to content

Commit 6f5455c

Browse files
committed
fix: catch GItHub API call rejections
ref: issue #51
1 parent 4e2f165 commit 6f5455c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ async function checkInputs() {
3232
headers = process.env.GITHUB_TOKEN ? {
3333
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`
3434
} : undefined,
35-
commit = (await axios.get(url, { headers })).data
35+
commit = (await axios.get(url, { headers }).catch(err => {
36+
info('::group::Request error:')
37+
info(`Request URL: ${url}`)
38+
info(err)
39+
info('::endgroup::')
40+
return undefined
41+
}))?.data
3642

3743
author = commit?.commit?.author
3844
}

0 commit comments

Comments
 (0)