Skip to content

Commit

Permalink
chore: fix publish TypeError: Cannot read property 'message' of undef…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Mar 15, 2021
1 parent daf4791 commit 810c254
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/scripts/ci/publish.ts
Expand Up @@ -1317,10 +1317,17 @@ function getLines(str: string): string[] {
}

async function getCommitInfo(repo: string, hash: string): Promise<CommitInfo> {
type Commit = {
message?: string
author: {
name: string
}
hash
}
return fetch(`https://api.github.com/repos/prisma/${repo}/commits/${hash}`)
.then((_) => _.json())
.then(({ commit }) => ({
message: commit.message,
.then(({ commit }: { commit: Commit }) => ({
message: commit.message || '',
author: commit.author.name,
hash,
}))
Expand Down

0 comments on commit 810c254

Please sign in to comment.