Skip to content

Commit 68c6ac8

Browse files
committed
Raise error on invalid GitHub API response
1 parent e8e7c5a commit 68c6ac8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ async function run() {
1111
// Get the download URL for the release
1212
const releaseUrl = `https://api.github.com/repos/apppackio/apppack/releases/${version}`;
1313
const data = await downloadJson(releaseUrl);
14+
if (!data.tag_name) {
15+
throw new Error(`Invalid API response: ${JSON.stringify(data)}`);
16+
}
1417
// strip the leading "v" from the tag name
1518
version = data.tag_name.slice(1);
1619
// Determine the platform-specific asset name

0 commit comments

Comments
 (0)