mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
Fix crash when org check is empty, run once weekly (#58281)
This commit is contained in:
@@ -103,11 +103,17 @@ async function fetchGhosts(users) {
|
||||
}
|
||||
|
||||
// Filter out organizations
|
||||
const query = `query {
|
||||
${ghosts.map((user, i) => `o${i}: organization(login: "${user}") { id }`).join("\n")}
|
||||
}`;
|
||||
const result = await tryGQL(() => octokit.graphql(query));
|
||||
return new Set(ghosts.filter(g => result.data[`o${ghosts.indexOf(g)}`] === null));
|
||||
if (ghosts.length) {
|
||||
const query = `query {
|
||||
${ghosts.map((user, i) => `o${i}: organization(login: "${user}") { id }`).join("\n")}
|
||||
}`;
|
||||
const result = await tryGQL(() => octokit.graphql(query));
|
||||
if (result.data) {
|
||||
return new Set(ghosts.filter(g => result.data[`o${ghosts.indexOf(g)}`] === null));
|
||||
}
|
||||
}
|
||||
|
||||
return new Set(ghosts);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user