Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/github/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
Expand Down
6 changes: 6 additions & 0 deletions tests/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down