diff --git a/Directory.Build.props b/Directory.Build.props index 787c5a1..a5d5f12 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,5 @@ - 1.9.0-rc + 1.9.0-rc.1 \ No newline at end of file diff --git a/ricaun.Nuke/Extensions/GitHubExtension.cs b/ricaun.Nuke/Extensions/GitHubExtension.cs index aec2e67..964da5c 100644 --- a/ricaun.Nuke/Extensions/GitHubExtension.cs +++ b/ricaun.Nuke/Extensions/GitHubExtension.cs @@ -27,13 +27,21 @@ public static bool IsForked(this GitRepository gitRepository) if (gitRepository is null) return false; - var gitHubOwner = gitRepository.GetGitHubOwner(); - var gitHubName = gitRepository.GetGitHubName(); - var repository = GitHubTasks.GitHubClient.Repository - .Get(gitHubOwner, gitHubName) - .Result; + try + { + var gitHubOwner = gitRepository.GetGitHubOwner(); + var gitHubName = gitRepository.GetGitHubName(); + var repository = GitHubTasks.GitHubClient.Repository + .Get(gitHubOwner, gitHubName) + .Result; - return repository.Fork; + return repository.Fork; + } + catch + { + // Private repository is not forked. + return false; + } } #region GitHubUtil