Skip to content

Commit

Permalink
chore: fix publish script getCommitInfo (#7131)
Browse files Browse the repository at this point in the history
For integration branches
  • Loading branch information
Jolg42 committed May 18, 2021
1 parent 1c992e4 commit 9eaeb8f
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/scripts/ci/publish.ts
Expand Up @@ -1339,18 +1339,15 @@ function getLines(str: string): string[] {
}

async function getCommitInfo(repo: string, hash: string): Promise<CommitInfo> {
type Commit = {
message?: string
author: {
name: string
}
hash
const response = await fetch(
`https://api.github.com/repos/prisma/${repo}/commits/${hash}`,
)

const jsonData = await response.json()

return {
message: jsonData.commit?.message || '',
author: jsonData.commit?.author.name || '',
hash,
}
return fetch(`https://api.github.com/repos/prisma/${repo}/commits/${hash}`)
.then((_) => _.json())
.then(({ commit }: { commit: Commit }) => ({
message: commit.message || '',
author: commit.author.name,
hash,
}))
}

0 comments on commit 9eaeb8f

Please sign in to comment.