Skip to content
Merged
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
9 changes: 3 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33228,17 +33228,14 @@ async function run() {
//Remove Invalid users
for (const user of trimmed_owners.toReversed()) {
try {
const response = await octokit.rest.issues.checkUserCanBeAssigned({
await octokit.rest.issues.checkUserCanBeAssigned({
owner: core_owner,
repo: core_repo,
assignee: user
});
if (response.status != 204) {
throw new Error(`Cannot be requested for review, make sure they are a member of a team with read access.`);
}
}
catch (ex) {
notice(`Error verifying user ${user}: ${ex}`);
catch {
notice(`User ${user}: Cannot be requested for review, make sure they are a member of a team with read access.`);
trimmed_owners.splice(trimmed_owners.indexOf(user), 1);
}
}
Expand Down
22 changes: 9 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,15 @@ async function run(): Promise<void> {
//Remove Invalid users
for (const user of trimmed_owners.toReversed()) {
try {
const response: RestEndpointMethodTypes['issues']['checkUserCanBeAssigned']['response'] =
await octokit.rest.issues.checkUserCanBeAssigned({
owner: core_owner,
repo: core_repo,
assignee: user
})
if (response.status != 204) {
throw new Error(
`Cannot be requested for review, make sure they are a member of a team with read access.`
)
}
} catch (ex) {
notice(`Error verifying user ${user}: ${ex}`)
await octokit.rest.issues.checkUserCanBeAssigned({
owner: core_owner,
repo: core_repo,
assignee: user
})
} catch {
notice(
`User ${user}: Cannot be requested for review, make sure they are a member of a team with read access.`
)
trimmed_owners.splice(trimmed_owners.indexOf(user), 1)
}
}
Expand Down