Fetch staff members from GitHub org
This commit is contained in:
parent
4818e0b7eb
commit
10937c6e37
1 changed files with 21 additions and 26 deletions
|
@ -9,30 +9,30 @@ const PULL_REQUEST_API_URL =
|
||||||
"https://api.github.com/repos/zed-industries/zed/pulls";
|
"https://api.github.com/repos/zed-industries/zed/pulls";
|
||||||
const DIVIDER = "-".repeat(80);
|
const DIVIDER = "-".repeat(80);
|
||||||
|
|
||||||
// Maintain list manually, as our GitHub organization has community members in it.
|
|
||||||
const STAFF_MEMBERS = new Set([
|
|
||||||
"as-cii",
|
|
||||||
"bennetbo",
|
|
||||||
"conradirwin",
|
|
||||||
"danilo-leal",
|
|
||||||
"iamnbutler",
|
|
||||||
"josephtlyons",
|
|
||||||
"jvmncs",
|
|
||||||
"maxbrunsfeld",
|
|
||||||
"maxdeviant",
|
|
||||||
"mikayla-maki",
|
|
||||||
"nathansobo",
|
|
||||||
"notpeter",
|
|
||||||
"osiewicz",
|
|
||||||
"rgbkrk",
|
|
||||||
"rtfeldman",
|
|
||||||
"someonetoignore",
|
|
||||||
"thorstenball",
|
|
||||||
]);
|
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
const STAFF_MEMBERS = new Set(
|
||||||
|
(
|
||||||
|
await (
|
||||||
|
await fetch(
|
||||||
|
"https://api.github.com/orgs/zed-industries/teams/staff/members",
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
Authorization: `token ${GITHUB_ACCESS_TOKEN}`,
|
||||||
|
Accept: "application/vnd.github+json",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
).json()
|
||||||
|
).map(({ login }) => login.toLowerCase()),
|
||||||
|
);
|
||||||
|
|
||||||
|
const isStaffMember = (githubHandle) => {
|
||||||
|
githubHandle = githubHandle.toLowerCase();
|
||||||
|
return STAFF_MEMBERS.has(githubHandle);
|
||||||
|
};
|
||||||
|
|
||||||
// Get the last two preview tags
|
// Get the last two preview tags
|
||||||
const [newTag, oldTag] = execFileSync(
|
const [newTag, oldTag] = execFileSync(
|
||||||
"git",
|
"git",
|
||||||
|
@ -142,8 +142,3 @@ function getPullRequestNumbers(oldTag, newTag) {
|
||||||
|
|
||||||
return pullRequestNumbers;
|
return pullRequestNumbers;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isStaffMember(githubHandle) {
|
|
||||||
githubHandle = githubHandle.toLowerCase();
|
|
||||||
return STAFF_MEMBERS.has(githubHandle);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue