diff --git a/dist/index.js b/dist/index.js index ac22ec7..ab3778f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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); } } diff --git a/src/index.ts b/src/index.ts index 050a3d0..be711e1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -170,19 +170,15 @@ async function run(): Promise { //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) } }