mirror of
https://github.com/homarr-labs/dashboard-icons.git
synced 2026-01-12 16:25:38 +08:00
fix(scripts): write GitHub author ids and avoid email logins
This commit is contained in:
@@ -11,6 +11,7 @@ interface PBUser {
|
||||
id: string;
|
||||
username?: string;
|
||||
email?: string;
|
||||
github_id?: string;
|
||||
}
|
||||
|
||||
interface SubmissionExtras {
|
||||
@@ -299,10 +300,19 @@ function buildAuthor(submission: Submission): MetadataAuthor {
|
||||
return { id: submission.created_by };
|
||||
}
|
||||
|
||||
if (creator.github_id) {
|
||||
const githubId = Number(creator.github_id);
|
||||
if (Number.isFinite(githubId) && githubId > 0) {
|
||||
return {
|
||||
id: githubId,
|
||||
...(creator.username ? { login: creator.username } : {}),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
id: creator.id,
|
||||
...(creator.username ? { name: creator.username } : {}),
|
||||
...(creator.email ? { login: creator.email } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user