File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments