Skip to content
Closed
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
11 changes: 6 additions & 5 deletions .github/contributors/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const buildContributorInfo = async (contributors: WeightedContributor[]): Promis
fragment UserFragment on User {
login
name
websiteUrl
avatarUrl
}`

Expand All @@ -70,21 +69,21 @@ const buildContributorInfo = async (contributors: WeightedContributor[]): Promis
}
}

const buildCoreTeamInfo = async (): Promise<ContributorInfo[]> => {
const getTeamInfo = async (teamName: string): Promise<ContributorInfo[]> => {
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}`,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions .github/contributors/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export type ContributorInfo = {
name: string
avatarUrl: string
websiteUrl: string
isTeamMember: boolean
}

export type DataJSON = {
Expand Down
15 changes: 8 additions & 7 deletions .github/contributors/rewrite_readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ ${rows
`<tr>\n${row
.map(
(c) =>
` <td align="center"><a href="${
c.websiteUrl ? (c.websiteUrl.startsWith("http") ? c.websiteUrl : `https://${c.websiteUrl}`) : `https://github.com/${c.login}`
}?utm_source=golangci-lint-contributors"><img src="${c.avatarUrl}" width="100px;" alt=""/><br /><sub><b>${
c.name ? c.name : `@${c.login}`
}</b></sub></a></td>`
` <td align="center" valign="top"${
contributors.length >= colPerRow ? ` width="14.28%"` : ``
}><a href="https://github.com/${c.login}"><img src="${c.avatarUrl}" width="100px;" alt=""/>` +
`<br /><sub><b>${c.name ? c.name : `@${c.login}`}</b>${c.isTeamMember ? "🔹" : ""}</sub></a></td>`
)
.join(`\n`)}\n</tr>`
)
Expand Down Expand Up @@ -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))}

<details>
<summary>And ${hiddenCount} more our team members</summary>
<summary>And ${hiddenCount} more contributors</summary>

${buildContributorsTable(data.contributors.slice(visibleCount))}

Expand Down
Loading