mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Tools: Improve getting GitHub name for git-changelog
This commit is contained in:
parent
56b010ba0e
commit
42483a4d46
@ -273,6 +273,11 @@ export const gitCurrentBranch = async (): Promise<string> => {
|
||||
};
|
||||
|
||||
export async function githubUsername(email: string, name: string) {
|
||||
if (email.endsWith('@users.noreply.github.com')) {
|
||||
const splitted = email.split('@')[0].split('+');
|
||||
return splitted.length === 1 ? splitted[0] : splitted[1];
|
||||
}
|
||||
|
||||
const cache = await loadGitHubUsernameCache();
|
||||
const cacheKey = `${email}:${name}`;
|
||||
if (cacheKey in cache) return cache[cacheKey];
|
||||
|
Loading…
Reference in New Issue
Block a user