@@ -4,6 +4,7 @@ const ignoredUsers = process.env.IGNORED_USERS.toLowerCase().split(',')
44
55const octokit = getAuthenticatedOctokit ( )
66
7+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
78export function getAuthenticatedOctokit ( ) {
89 return new Octokit ( {
910 authStrategy : createAppAuth ,
@@ -15,7 +16,7 @@ export function getAuthenticatedOctokit() {
1516 } )
1617}
1718
18- export async function getGithubUsersFromGithub ( ) {
19+ export async function getGithubUsersFromGithub ( ) : Set < string > {
1920 const members = await octokit . paginate ( octokit . orgs . listMembers , {
2021 org : process . env . GITHUB_ORG ,
2122 } )
@@ -33,11 +34,12 @@ export async function getGithubUsersFromGithub() {
3334 return new Set ( [ ...githubAccounts , ...pendingGithubAccounts ] )
3435}
3536
37+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
3638export function formatUserList ( users ) : Set < string > {
3739 return new Set ( users . map ( ( user ) => user . login . toLowerCase ( ) ) )
3840}
3941
40- export async function getUserIdFromUsername ( username : string ) {
42+ export async function getUserIdFromUsername ( username : string ) : Promise < number > {
4143 console . log ( `Looking up user ${ username } ` )
4244 let user
4345 try {
@@ -49,13 +51,13 @@ export async function getUserIdFromUsername(username: string) {
4951 return user . data . id
5052}
5153
52- export async function addUsersToGitHubOrg ( users : Set < string > ) {
54+ export async function addUsersToGitHubOrg ( users : Set < string > ) : Promise < void > {
5355 for ( const user of users ) {
5456 await addUserToGitHubOrg ( user )
5557 }
5658}
5759
58- export async function addUserToGitHubOrg ( user : string ) {
60+ export async function addUserToGitHubOrg ( user : string ) : Promise < void > {
5961 if ( ignoredUsers . includes ( user . toLowerCase ( ) ) ) {
6062 console . log ( `Ignoring add for ${ user } ` )
6163 return false
@@ -69,12 +71,13 @@ export async function addUserToGitHubOrg(user: string) {
6971 console . log ( `Invitation sent to ${ user } (${ userId } to ${ process . env . GITHUB_ORG } )` )
7072}
7173
72- export async function removeUsersToGitHubOrg ( users : Set < string > ) {
74+ export async function removeUsersToGitHubOrg ( users : Set < string > ) : Promise < void > {
7375 for ( const user of users ) {
7476 await removeUserToGitHubOrg ( user )
7577 }
7678}
7779
80+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
7881export async function removeUserToGitHubOrg ( user : string ) {
7982 if ( ignoredUsers . includes ( user . toLowerCase ( ) ) ) {
8083 console . log ( `Ignoring remove for ${ user } ` )
0 commit comments