Skip to content

Commit 4c4bf90

Browse files
committed
fix build, filter for public org
1 parent 1a6260e commit 4c4bf90

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

.vitepress/data/maintainers.data.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,29 @@ const octokit = new Octokit({ auth: GITHUB_TOKEN });
66

77
export default {
88
async load() {
9-
const members = await octokit.paginate(
10-
octokit.rest.teams.listMembersInOrg,
11-
{
12-
org: "FabricMC",
13-
team_slug: "documentation",
9+
const members = await (async () => {
10+
try {
11+
return await octokit.paginate(octokit.rest.teams.listMembersInOrg, {
12+
org: "FabricMC",
13+
team_slug: "documentation",
14+
});
15+
} catch (e) {
16+
// Allows build without a GITHUB_TOKEN
17+
return [];
1418
}
15-
);
19+
})();
1620

1721
return members
1822
.filter((contributor) => contributor.login !== "FabricMCBot")
23+
.filter(async (contributor) =>
24+
(
25+
await octokit.paginate(octokit.rest.orgs.listForUser, {
26+
username: contributor.login,
27+
})
28+
)
29+
.map((org) => org.login)
30+
.includes("FabricMC")
31+
)
1932
.map(
2033
(member) =>
2134
({

0 commit comments

Comments
 (0)