Skip to content

Commit

Permalink
🐛 replace all in GitHub name
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaTheMiller committed Mar 26, 2023
1 parent e5df35a commit 0085419
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/githubSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ import { SearchAllAsync } from "./ldapClient";

const teamDescription = "🤖 This Team is controlled by the Groups to Teams Sync bot! Any changes will be overridden. For more information, please check out the following: https://github.com/cloudpups/groups-to-teams-sync-bot";

const replaceAll = function(original:string, search:string, replacement:string) {
var target = original;
return target.replace(new RegExp(search, 'g'), replacement);
};

async function GetGitHubIds(teamName: string, config: AppConfig) {
const membersFromSourceOfTruth = await SearchAllAsync(teamName);

return membersFromSourceOfTruth.entries.map(e => {
return e.cn.replace('_', '-') + config.GitHubIdAppend;
return replaceAll(e.cn, '_', '-') + config.GitHubIdAppend;
})
}

Expand Down

0 comments on commit 0085419

Please sign in to comment.