File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,18 @@ export class LeviLaminaFetcher extends GitHubFetcher {
5151 return null
5252 }
5353
54- let avatarUrl = tooth . info ?. avatar_url ?? `https://avatars.githubusercontent.com/${ repo . owner } `
54+ let avatarUrl = tooth . info ?. avatar_url ?? ''
55+
56+ // If empty, use the repository owner's avatar
57+ if ( avatarUrl === '' ) {
58+ avatarUrl = `https://avatars.githubusercontent.com/${ repo . owner } `
59+ }
5560
5661 // Check if avatarUrl is relative and make it absolute if needed
5762 if ( ! / ^ (?: [ a - z + ] + : ) ? \/ / i. test ( avatarUrl ) ) {
5863 avatarUrl = `https://raw.githubusercontent.com/${ repo . owner } /${ repo . repo } /HEAD/${ avatarUrl } `
5964 }
65+
6066 // Check if avatarUrl starts with https://github.com/{owner}/{repo}/blob and convert it to raw.githubusercontent.com
6167 const githubUrlRegex = / ^ h t t p s : \/ \/ g i t h u b \. c o m \/ ( [ A - Z a - z 0 - 9 - ] + ) \/ ( [ \w . - ] + ) \/ b l o b \/ ( .+ ) /
6268 const githubUrlRegexMatch = githubUrlRegex . exec ( avatarUrl )
You can’t perform that action at this time.
0 commit comments