public static string GetGitHubName(this GitRepository repository) { ControlFlow.Assert(repository.IsGitHubRepository(), "repository.IsGitHubRepository()"); return(repository.Identifier.Split('/')[1]); }
public override object GetValue(MemberInfo member, object instance) { return(GitRepository.FromLocalDirectory(NukeBuild.RootDirectory)); }
public static bool IsOnHotfixBranch(this GitRepository repository) { return(repository.Branch?.StartsWithOrdinalIgnoreCase("hotfix/") ?? false); }
public static bool IsGitHubRepository(this GitRepository repository) { return(repository != null && repository.Endpoint.EqualsOrdinalIgnoreCase("github.com")); }
// public static bool IsOnBugfixBranch(this GitRepository repository) // { // return repository.Branch?.StartsWithOrdinalIgnoreCase("feature/fix-") ?? false; // } public static bool IsOnReleaseBranch(this GitRepository repository) { return(repository.Branch?.StartsWithOrdinalIgnoreCase("release/") ?? false); }
public static bool IsOnDevelopBranch(this GitRepository repository) { return((repository.Branch?.EqualsOrdinalIgnoreCase("dev") ?? false) || (repository.Branch?.EqualsOrdinalIgnoreCase("develop") ?? false) || (repository.Branch?.EqualsOrdinalIgnoreCase("development") ?? false)); }
public static bool IsOnMasterBranch(this GitRepository repository) { return(repository.Branch?.EqualsOrdinalIgnoreCase("master") ?? false); }
private static string GetMethod([CanBeNull] string relativePath, GitHubItemType itemType, GitRepository repository) { var absolutePath = repository.LocalDirectory != null && relativePath != null ? PathConstruction.NormalizePath(Path.Combine(repository.LocalDirectory, relativePath)) : null; if (itemType == GitHubItemType.Directory || Directory.Exists(absolutePath) || relativePath == null) { return("tree"); } if (itemType == GitHubItemType.File || File.Exists(absolutePath)) { return("blob"); } return(null); }
public override object GetStaticValue() { return(Value = Value ?? ControlFlow.SuppressErrors(() => GitRepository.FromLocalDirectory(NukeBuild.Instance.RootDirectory, Branch, Remote.NotNull()))); }