Skip to content

Commit 4741716

Browse files
committed
chore: update contributors list and address review feedback
- Rename html_url field to login in defaultContributorsList (was storing a username, not a URL — misleading field name) - Update the update script to output login instead of html_url - Update Contributors.svelte fallback render to use contributor.login - Bump engines.node from >=20.19.0 to >=26.0.0 to match @types/node v26 - Document fork/archive filtering in the update-contributors skill
1 parent d61b650 commit 4741716

5 files changed

Lines changed: 83 additions & 185 deletions

File tree

.github/skills/update-contributors/SKILL.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ npm run update-contributors
4545
### 3. What the script does
4646

4747
1. Fetches all repositories from the Torrust GitHub organization
48-
2. Fetches contributors from each repository
49-
3. Deduplicates contributors by username
50-
4. Updates `defaultContributorsList` in `src/lib/constants/constants.ts`
48+
2. **Filters out forked and archived repositories** — forks include upstream contributors from projects Torrust doesn't own (e.g. `cargo-chef`, `grcov`), and archived repos are no longer active
49+
3. Fetches contributors from each remaining repository (using the GitHub `/contributors` endpoint, which returns users who have authored at least one commit)
50+
4. Deduplicates contributors by username
51+
5. Updates `defaultContributorsList` in `src/lib/constants/constants.ts`
5152

5253
### 4. Verify and commit
5354

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"engines": {
7-
"node": ">=20.19.0"
7+
"node": ">=26.0.0"
88
},
99
"scripts": {
1010
"dev": "vite dev",

scripts/updateContributors.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ type Contributor = {
1313

1414
type Repo = {
1515
name: string;
16+
fork: boolean;
17+
archived: boolean;
1618
};
1719

1820
async function fetchWithAuth(url: string): Promise<Response> {
@@ -47,9 +49,12 @@ async function fetchRepos(): Promise<string[]> {
4749
}
4850

4951
const repos: Repo[] = await response.json();
50-
console.log(`✓ Found ${repos.length} repositories`);
52+
const filteredRepos = repos.filter((repo) => !repo.fork && !repo.archived);
53+
console.log(
54+
`✓ Found ${repos.length} repositories (${filteredRepos.length} after excluding forks and archived)`
55+
);
5156

52-
return repos.map((repo) => repo.name);
57+
return filteredRepos.map((repo) => repo.name);
5358
}
5459

5560
async function fetchContributorsForRepo(repoName: string): Promise<Contributor[]> {
@@ -157,7 +162,7 @@ function updateConstantsFile(contributors: Contributor[]): void {
157162

158163
// Format contributors list
159164
const contributorEntries = contributors
160-
.map((c) => `\t{\n\t\thtml_url: '${c.login}',\n\t\tavatar_url: '${c.avatar_url}'\n\t}`)
165+
.map((c) => `\t{\n\t\tlogin: '${c.login}',\n\t\tavatar_url: '${c.avatar_url}'\n\t}`)
161166
.join(',\n');
162167

163168
const newList = `export const defaultContributorsList = [\n${contributorEntries}\n];`;

src/lib/components/organisms/Contributors.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
{#each defaultContributorsList as contributor}
2020
<div>
2121
<a
22-
href="https://github.com/{contributor.html_url}"
22+
href="https://github.com/{contributor.login}"
2323
target="_blank"
24-
title={contributor.html_url}
24+
title={contributor.login}
2525
>
2626
<img src={contributor.avatar_url} alt="contributor" />
2727
</a>

0 commit comments

Comments
 (0)