@@ -50,7 +50,9 @@ async function GetGitHubIds(teamName: string, config: AppConfig): Promise<GitHub
5050 return {
5151 Succeeded : true ,
5252 Ids : membersFromSourceOfTruth . entries . map ( e => {
53- return replaceAll ( e . cn , '_' , '-' ) + config . GitHubIdAppend ;
53+ const replace1 = replaceAll ( e . cn , '_' , '-' ) ;
54+ const replace2 = replace1 . replaceAll ( "." , "-" ) ;
55+ return replace2 + config . GitHubIdAppend ;
5456 } )
5557 }
5658}
@@ -108,7 +110,7 @@ async function SynchronizeOrgMembers(installedGitHubClient: InstalledClient, tea
108110 } ;
109111}
110112
111- async function SynchronizeGitHubTeam ( installedGitHubClient : InstalledClient , teamName : string , config : AppConfig , existingInvites : OrgInvite [ ] , sourceTeamMap : Map < string , string > , checkOrgMembers : boolean = true ) {
113+ async function SynchronizeGitHubTeam ( installedGitHubClient : InstalledClient , teamName : string , config : AppConfig , existingInvites : OrgInvite [ ] , sourceTeamMap : Map < string , string > , checkOrgMembers : boolean = true , dryRun : boolean = false ) {
112114 function GetSourceOrReturn ( teamName : string ) {
113115 return sourceTeamMap . get ( teamName ) ?? teamName ;
114116 }
@@ -170,6 +172,10 @@ async function SynchronizeGitHubTeam(installedGitHubClient: InstalledClient, tea
170172
171173 Log ( JSON . stringify ( teamSyncNotes ) ) ;
172174
175+ if ( dryRun === true ) {
176+ return teamSyncNotes ;
177+ }
178+
173179 const deleteResponses = await Promise . all ( teamMembersToRemove . map ( mtr => installedGitHubClient . RemoveTeamMemberAsync ( teamName , mtr ) ) ) ;
174180 const addResponses = await Promise . all ( teamMembersToAdd . map ( mta => installedGitHubClient . AddTeamMember ( teamName , mta ) ) ) ;
175181
@@ -473,8 +479,8 @@ async function syncOrg(installedGitHubClient: InstalledClient, appConfig: AppCon
473479}
474480
475481
476- export async function SyncTeam ( teamName : string , client : InstalledClient , config : AppConfig , invites : OrgInvite [ ] , sourceTeamMap : Map < string , string > ) {
477- const response = await SynchronizeGitHubTeam ( client , teamName , config , invites , sourceTeamMap , true ) ;
482+ export async function SyncTeam ( teamName : string , client : InstalledClient , config : AppConfig , invites : OrgInvite [ ] , sourceTeamMap : Map < string , string > , dryRun : boolean = false ) {
483+ const response = await SynchronizeGitHubTeam ( client , teamName , config , invites , sourceTeamMap , true , dryRun ) ;
478484
479485 return response ;
480486}
0 commit comments