Skip to content

Commit 29d45b3

Browse files
committed
chore: skip non-existent authors
1 parent b3229ed commit 29d45b3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/update-changelog.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,16 @@ export async function getContributors() {
221221
if (emails.has(commit.author.email) || commit.author.name === 'renovate[bot]') {
222222
continue
223223
}
224-
const { author } = await fetch(`https://api.github.com/repos/${repo}/commits/${commit.shortHash}`, {
224+
const { author } = await $fetch<{ author: { login: string, email: string } }>(`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-
}).then(r => r.json() as Promise<{ author: { login: string, email: string } }>)
230+
})
231+
if (!author) {
232+
continue
233+
}
231234
if (!contributors.some(c => c.username === author.login)) {
232235
contributors.push({ name: commit.author.name, username: author.login })
233236
}

0 commit comments

Comments
 (0)