Skip to content

Commit c3a8051

Browse files
authored
Extra validation check for manifest tags (#11)
1 parent 499b218 commit c3a8051

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml/CatalogManager.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,19 @@ private async Task CheckTags(CatalogYaml catalogYaml)
184184
catalogYaml.Tags = new List<string>();
185185
}
186186

187+
if(catalogYaml.Tags.Count >= 5)
188+
{
189+
logger.LogDebug("Catalog YAML has the max amount of tags already. Skipping the adding GitHub topics step.");
190+
return;
191+
}
192+
187193
var topics = await service.GetRepositoryTopicsAsync();
188194
if (topics is { Count: > 0 })
189195
{
190196
catalogYaml.Tags.AddRange(topics);
191197

192198
// Remove duplicates
193-
catalogYaml.Tags = catalogYaml.Tags.Distinct().ToList();
199+
catalogYaml.Tags = catalogYaml.Tags.Distinct().Take(5).ToList();
194200
logger.LogDebug("Distinct GitHub Topics found and applied.");
195201
}
196202
}

0 commit comments

Comments
 (0)