diff --git a/.github/contributors/generate.ts b/.github/contributors/generate.ts index beef913ba7ff..64cb1b1eb2cc 100644 --- a/.github/contributors/generate.ts +++ b/.github/contributors/generate.ts @@ -49,7 +49,6 @@ const buildContributorInfo = async (contributors: WeightedContributor[]): Promis fragment UserFragment on User { login name - websiteUrl avatarUrl }` @@ -70,21 +69,21 @@ const buildContributorInfo = async (contributors: WeightedContributor[]): Promis } } -const buildCoreTeamInfo = async (): Promise => { +const getTeamInfo = async (teamName: string): Promise => { const query = `{ organization(login:"golangci"){ - team(slug:"core-team"){ + team(slug:"${teamName}"){ members { nodes { login name - websiteUrl avatarUrl } } } } }` + const resp = await graphql.graphql(query, { headers: { authorization: `token ${process.env.GITHUB_TOKEN}`, @@ -115,8 +114,10 @@ const main = async () => { loginToWeight.forEach((weight, login) => weightedContributors.push({ login, weight })) weightedContributors.sort((a, b) => b.weight - a.weight) - const coreTeamInfo = await buildCoreTeamInfo() + const coreTeamInfo = await getTeamInfo("core-team") + const teamInfo = await getTeamInfo("team") const contributorsInfo = await buildContributorInfo(weightedContributors) + contributorsInfo.map((c) => (c.isTeamMember = teamInfo.some((ti) => ti.login == c.login))) const exclude: any = { golangcidev: true, CLAassistant: true, diff --git a/.github/contributors/info.ts b/.github/contributors/info.ts index fbb768f7a292..b085618fbec2 100644 --- a/.github/contributors/info.ts +++ b/.github/contributors/info.ts @@ -3,6 +3,7 @@ export type ContributorInfo = { name: string avatarUrl: string websiteUrl: string + isTeamMember: boolean } export type DataJSON = { diff --git a/.github/contributors/rewrite_readme.ts b/.github/contributors/rewrite_readme.ts index 3417b2ea90ff..d980653ef33d 100644 --- a/.github/contributors/rewrite_readme.ts +++ b/.github/contributors/rewrite_readme.ts @@ -40,11 +40,10 @@ ${rows `\n${row .map( (c) => - `
${ - c.name ? c.name : `@${c.login}` - }
` + ` = colPerRow ? ` width="14.28%"` : `` + }>` + + `
${c.name ? c.name : `@${c.login}`}${c.isTeamMember ? "🔹" : ""}
` ) .join(`\n`)}\n` ) @@ -82,12 +81,14 @@ The Core Team has the following responsibilities: ${buildContributorsTable(data.coreTeam)} -### Team +### Contributors + +These contributors have helped shape \`golangci-lint\` into what it is today. Team members are marked with a '🔹' next to their names. ${buildContributorsTable(data.contributors.slice(0, visibleCount))}
-And ${hiddenCount} more our team members +And ${hiddenCount} more contributors ${buildContributorsTable(data.contributors.slice(visibleCount))}