// Builds a contact sheet of the top contributors' avatars, for reviewing which ones are photos of a // human face (src/lib/contributor-faces.ts). // // bun script/contributor-faces.ts [out.html] // // Open the HTML file, and for each avatar that is clearly a photo of a person's face add its login, // id and commit count (the caption's "id · commits") to the allowlist; refresh the counts of the // entries already there, as they order the wall when GitHub doesn't answer. Avatars already on the allowlist are outlined, so a refresh only needs a // look at the new ones (and at allowlisted ones whose picture changed). import { faces } from "../src/lib/contributor-faces" const repo = "anomalyco/opencode" const out = Bun.argv[2] ?? `${process.env.TMPDIR ?? "/tmp"}/contributor-faces.html` const allowed = new Set(faces.map((face) => face.login)) type Contributor = { login: string; id: number; type: string; avatar_url: string; contributions: number } const pages = await Promise.all( [1, 2].map((page) => fetch(`https://api.github.com/repos/${repo}/contributors?per_page=100&page=${page}`, { headers: { Accept: "application/vnd.github+json", "User-Agent": "OpenCode-Console" }, }).then((response) => { if (!response.ok) throw new Error(`GitHub answered ${response.status} for page ${page}`) return response.json() as Promise }), ), ) const people = pages.flat().filter((person) => person.type === "User") const cells = people .map( (person, index) => `
${index + 1}. ${person.login}
${person.id} · ${person.contributions}
`, ) .join("\n") await Bun.write( out, `Contributor faces

${people.length} contributors (users only, by commits). Outlined: on the allowlist (${allowed.size}).

${cells}
`, ) console.log(`${people.length} avatars → ${out}`)