Examples

The following example prints the number of binary files which are not tracked by Git Large File Storage in a repository.

Warning

Checking binary files requires Git and Git Large File Storage available on the local machine.

To analyze Git repositories you need to import the core addin and the Git repository support:

#addin nuget:?package=Cake.Issues&version=5.0.1
#addin nuget:?package=Cake.Issues.GitRepository&version=5.0.1

We need some global variables:

var repoRootPath = @"c:\repo";

The following task will analyze the repository:

Task("Analyze-Repo")
.Does(() =>
{
    // Read Issues.
    var settings =
        new GitRepositoryIssuesSettings
        {
            CheckBinaryFilesTrackedByLfs = true
        };

    var issues =
        ReadIssues(
            GitRepositoryIssues(settings),
            repoRootPath);

    Information("{0} issues are found.", issues.Count());
});