Skip to content

Commit

Permalink
🐛 remove empty team names, ignore NA/na
Browse files Browse the repository at this point in the history
* This will help catch configuration issues that may be introduced by humans
* This also inserts an opinion that may be adjusted later- that NA and
  na are not valid team names... This is to account for the fact that
  existing users were using this name in their configuration files to
  cause the sync bot to "skip" the team, even though under the covers
  the sync bot would fail (before).
  • Loading branch information
JoshuaTheMiller committed Feb 11, 2023
1 parent fb0807f commit 2bae390
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions source/Gttsb.Gh/Bootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ public static async Task<bool> StartTeamSyncAsync(IActiveDirectoryFacade activeD

var org = gitHubFacade.OrgName;

var groupsToSyncronize = groupDisplayNames.Select(g => new
{
Key = g.Key,
Value = new TeamDefinition("ActiveDirectory", g.Key)
}).ToDictionary(o => o.Key, o => o.Value);
var groupsToSyncronize = groupDisplayNames.Where(n => !string.IsNullOrWhiteSpace(n.Key))
.Where(n => !(n.Key == "NA" || n.Key == "na"))
.Select(g => new
{
Key = g.Key,
Value = new TeamDefinition("ActiveDirectory", g.Key)
})
.ToDictionary(o => o.Key, o => o.Value);

Console.WriteLine("This Action will attempt to syncronize the following groups:");
Console.WriteLine("The sync tool will attempt to syncronize the following groups:");
foreach (var group in groupsToSyncronize)
{
Console.WriteLine($"* {group.Key}");
Expand Down

0 comments on commit 2bae390

Please sign in to comment.