scripts/update contributor list: add full name support for pinned contributors

This commit is contained in:
Adorian Doran
2026-03-22 22:35:59 +02:00
parent 015e50cdb8
commit b32dd949d7
3 changed files with 22 additions and 12 deletions

View File

@@ -3,13 +3,15 @@
"contributors": [
{
"name": "eliandoran",
"role": "lead-dev",
"url": "https://github.com/eliandoran"
"url": "https://github.com/eliandoran",
"fullName": "Elian Doran",
"role": "lead-dev"
},
{
"name": "zadam",
"role": "original-dev",
"url": "https://github.com/zadam"
"url": "https://github.com/zadam",
"fullName": "Zadam",
"role": "original-dev"
},
{
"name": "adoriandoran",

View File

@@ -4,6 +4,7 @@ export interface ContributorList {
export interface Contributor {
name: string;
fullName?: string;
url: string;
role?: "lead-dev" | "original-dev";
}

View File

@@ -4,9 +4,9 @@ import {Contributor, ContributorList} from "../packages/commons/";
// Keep honorific contributors at top of the list, even if their commit count
// is exceeded by another users.
const PINNED_CONTRIBUTORS = {
"eliandoran": "lead-dev",
"zadam": "original-dev"
const PINNED_CONTRIBUTORS: Record<string, Pick<Contributor, "fullName" | "role">> = {
"eliandoran": {fullName: "Elian Doran", role: "lead-dev"},
"zadam": {fullName: "Zadam", role: "original-dev"}
};
// Bots marked as users on the GitHub profile info to exclude from the listing
@@ -46,11 +46,18 @@ function getList(contributorInfo: any[]) {
.filter((c) => c.type === "User" && !BOTS.includes(c.login))
// Sort by the commit count. Honorific contributors are always first.
.sort(contributorOrderer)
.map((c) => {return {
name: c.login,
role: (c.login in PINNED_CONTRIBUTORS) ? PINNED_CONTRIBUTORS[c.login]: undefined,
url: c.html_url
} as Contributor});
.map((c) => {
let result = {
name: c.login,
url: c.html_url
} as Contributor;
if (c.login in PINNED_CONTRIBUTORS) {
result = {...result, ...PINNED_CONTRIBUTORS[c.login]};
}
return result;
});
}
function contributorOrderer(a, b) {