Retrieve the current list of members for the provided group.
(group: string)
| 86 | |
| 87 | /** Retrieve the current list of members for the provided group. */ |
| 88 | async function getGroupMembers(group: string) { |
| 89 | /** The authenticated GitClient instance. */ |
| 90 | const git = await AuthenticatedGitClient.get(); |
| 91 | try { |
| 92 | return await git.github.teams |
| 93 | .listMembersInOrg({ |
| 94 | org: git.remoteConfig.owner, |
| 95 | team_slug: group, |
| 96 | }) |
| 97 | .then(({data}) => data.map((member) => member.login)); |
| 98 | } catch (e) { |
| 99 | if (e instanceof Error) { |
| 100 | Log.debug(e.stack ?? e.message); |
| 101 | } else { |
| 102 | Log.debug(String(e)); |
| 103 | } |
| 104 | return []; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | async function setGithubTeam(group: string, members: string[]) { |
| 109 | /** The authenticated GitClient instance. */ |
no test coverage detected