Skip to content

Commit 599c4d2

Browse files
committed
chore: use fetch api
1 parent 29d45b3 commit 599c4d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/update-changelog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ export async function getContributors() {
221221
if (emails.has(commit.author.email) || commit.author.name === 'renovate[bot]') {
222222
continue
223223
}
224-
const { author } = await $fetch<{ author: { login: string, email: string } }>(`https://api.github.com/repos/${repo}/commits/${commit.shortHash}`, {
224+
const { author } = await fetch(`https://api.github.com/repos/${repo}/commits/${commit.shortHash}`, {
225225
headers: {
226226
'User-Agent': `${repo} github action automation`,
227227
'Accept': 'application/vnd.github.v3+json',
228228
'Authorization': `token ${process.env.GITHUB_TOKEN}`,
229229
},
230-
})
230+
}).then(r => r.json() as Promise<{ author: { login: string, email: string } | null }>)
231231
if (!author) {
232232
continue
233233
}

0 commit comments

Comments
 (0)