File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,19 +27,22 @@ export async function getAdminService() {
2727export async function getGithubUsersFromGoogle ( ) : Promise < Set < string > > {
2828 const service = await mod . getAdminService ( )
2929 let githubAccounts = new Set < string > ( )
30- let pageToken = null
30+ let pageToken = null ;
3131
3232 do {
33- const userList = await service . users . list ( {
33+ let params = {
3434 customer : 'my_customer' ,
3535 maxResults : 250 ,
3636 projection : 'custom' ,
37- pageToken : pageToken ,
38- fields : 'users(customSchemas/Accounts/github(value)),pageToken' ,
37+ fields : 'users(customSchemas/Accounts/github(value)),nextPageToken' ,
3938 customFieldMask : 'Accounts' ,
40- } )
41- pageToken = userList . data . nextPageToken
42- githubAccounts = new Set ( [ ...githubAccounts , ...formatUserList ( userList . data . users ) ] )
39+ }
40+ if ( pageToken ) {
41+ params [ 'pageToken' ] = pageToken
42+ }
43+ const userList = await service . users . list ( params )
44+ pageToken = userList . data . nextPageToken
45+ githubAccounts = new Set ( [ ...githubAccounts , ...formatUserList ( userList . data . users ) ] )
4346 } while ( pageToken != null )
4447 return githubAccounts
4548}
You can’t perform that action at this time.
0 commit comments