Skip to content

Commit 184381e

Browse files
Merge pull request #281 from alejoroman0605/ignore-github-folder
Fix: Ignore .github folder when listing templates from GitHub repositories
2 parents e9de4ae + e0dfebc commit 184381e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

OpenContent/Components/Github/GithubTemplateUtils.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ public static List<Contents> GetTemplateList(int portalId)
6060
var response = client.GetStringAsync(new Uri(url)).Result;
6161
if (response != null)
6262
{
63+
// Parse the response and add the contents
64+
var allContents = Contents.FromJson(response);
65+
66+
// Filter the .github folder
67+
var filteredContents = allContents.Where(content => !content.Name.Equals(".github", StringComparison.OrdinalIgnoreCase)).ToList();
68+
6369
//content = JArray.Parse(response);
64-
contents .AddRange(Contents.FromJson(response));
70+
contents.AddRange(filteredContents);
6571
}
6672
}
6773
return contents;

0 commit comments

Comments
 (0)