diff --git a/DecSm.Atom.Module.DevopsWorkflows/Generation/DevopsWorkflowWriter.cs b/DecSm.Atom.Module.DevopsWorkflows/Generation/DevopsWorkflowWriter.cs index b22ae8e..a28ae4a 100644 --- a/DecSm.Atom.Module.DevopsWorkflows/Generation/DevopsWorkflowWriter.cs +++ b/DecSm.Atom.Module.DevopsWorkflows/Generation/DevopsWorkflowWriter.cs @@ -709,8 +709,15 @@ private static string FindProjectPath(IAtomFileSystem fileSystem, string project var projectPath = fileSystem .FileSystem .DirectoryInfo - .New(fileSystem.FileSystem.Directory.GetCurrentDirectory()) - .EnumerateFiles() + .New(fileSystem.AtomRootDirectory) + .EnumerateFiles("*.csproj", + new EnumerationOptions + { + IgnoreInaccessible = true, + MaxRecursionDepth = 4, + RecurseSubdirectories = true, + ReturnSpecialDirectories = false, + }) .FirstOrDefault(f => f.Name.Equals($"{projectName}.csproj", StringComparison.OrdinalIgnoreCase)); if (projectPath?.FullName is null) diff --git a/DecSm.Atom.Module.GithubWorkflows/Generation/GithubWorkflowWriter.cs b/DecSm.Atom.Module.GithubWorkflows/Generation/GithubWorkflowWriter.cs index 4eda211..4803bb8 100644 --- a/DecSm.Atom.Module.GithubWorkflows/Generation/GithubWorkflowWriter.cs +++ b/DecSm.Atom.Module.GithubWorkflows/Generation/GithubWorkflowWriter.cs @@ -797,8 +797,15 @@ private static string FindProjectPath(IAtomFileSystem fileSystem, string project var projectPath = fileSystem .FileSystem .DirectoryInfo - .New(fileSystem.FileSystem.Directory.GetCurrentDirectory()) - .EnumerateFiles() + .New(fileSystem.AtomRootDirectory) + .EnumerateFiles("*.csproj", + new EnumerationOptions + { + IgnoreInaccessible = true, + MaxRecursionDepth = 4, + RecurseSubdirectories = true, + ReturnSpecialDirectories = false, + }) .FirstOrDefault(f => f.Name.Equals($"{projectName}.csproj", StringComparison.OrdinalIgnoreCase)); if (projectPath?.FullName is null)