From ddfca8f320bb6aecf36743dc9f507626d828821d Mon Sep 17 00:00:00 2001 From: Ahtisham992 Date: Wed, 15 Jul 2026 17:22:07 +0500 Subject: [PATCH] fix(repos): include organization-created repositories in user repo list (#31) --- lib/github/client.ts | 2 +- tests/client.test.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/github/client.ts b/lib/github/client.ts index ee6100a..4ddafce 100644 --- a/lib/github/client.ts +++ b/lib/github/client.ts @@ -208,7 +208,7 @@ function profileQuery(): string { location createdAt followers { totalCount } - repositories(ownerAffiliations: OWNER, isFork: false, first: 100, orderBy: { field: STARGAZERS, direction: DESC }) { + repositories(ownerAffiliations: [OWNER, ORGANIZATION_MEMBER], isFork: false, first: 100, orderBy: { field: STARGAZERS, direction: DESC }) { totalCount nodes { nameWithOwner stargazerCount primaryLanguage { name } createdAt pushedAt } } diff --git a/tests/client.test.ts b/tests/client.test.ts index 98d43ef..3f84094 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -277,6 +277,12 @@ describe("fetchProfile language diversity (owned ∪ contributed)", () => { expect(calls[0].body).toContain("commitContributionsByRepository"); }); + it("includes ORGANIZATION_MEMBER affiliation so org-created repos count toward stars", async () => { + scriptFetch((_t, body) => (body.includes("query Profile") ? ok({ data: { user: USER_LANGS } }) : ok({ data: { user: {} } }))); + await fetchProfile(LOGIN, NOW); + expect(calls[0].body).toContain("ORGANIZATION_MEMBER"); + }); + it("folds contributed public repos into the language set, deduped against owned repos", async () => { scriptFetch((_t, body) => (body.includes("query Profile") ? ok({ data: { user: USER_LANGS } }) : ok({ data: { user: {} } }))); const payload = await fetchProfile(LOGIN, NOW);