Skip to content

Commit

Permalink
fix(publish): Correct types for github search API (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins authored May 21, 2024
1 parent 5de5a46 commit 8615668
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/publish/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,10 @@ export const publish = async (options) => {
},
},
)
/** @type {any} */
const data = await res.json()
username = data.items[0]?.login
const data = /** @type {{items: Array<{login: string}>}} */ (await res.json())
if (data.items && data.items[0]) {
username = data.items[0].login
}
}

const scope = commit.parsed.scope ? `${commit.parsed.scope}: ` : ''
Expand Down

0 comments on commit 8615668

Please sign in to comment.