mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
ci/github-script/bot: handle deleted maintainer accounts gracefully (#481949)
This commit is contained in:
commit
5c558b976c
2 changed files with 14 additions and 3 deletions
|
|
@ -133,6 +133,11 @@ module.exports = async ({ github, context, core, dry }) => {
|
|||
id,
|
||||
})
|
||||
.then((resp) => resp.data)
|
||||
.catch((e) => {
|
||||
// User may have deleted their account
|
||||
if (e.status === 404) return null
|
||||
throw e
|
||||
})
|
||||
}
|
||||
|
||||
return users[id]
|
||||
|
|
|
|||
|
|
@ -42,9 +42,15 @@ async function handleReviewers({
|
|||
}
|
||||
|
||||
const users = new Set([
|
||||
...(await Promise.all(
|
||||
maintainers.map(async (id) => (await getUser(id)).login.toLowerCase()),
|
||||
)),
|
||||
...(
|
||||
await Promise.all(
|
||||
maintainers.map(async (id) => {
|
||||
const user = await getUser(id)
|
||||
// User may have deleted their account
|
||||
return user?.login?.toLowerCase()
|
||||
}),
|
||||
)
|
||||
).filter(Boolean),
|
||||
...owners
|
||||
.filter((handle) => handle && !handle.includes('/'))
|
||||
.map((handle) => handle.toLowerCase()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue