AzurePipelinesEnvironmentInfo.

Repository Property

Summary

Gets Azure Pipelines repository information.

Syntax

public AzurePipelinesRepositoryInfo Repository { get; }

Examples

if (BuildSystem.AzurePipelines.IsRunningOnAzurePipelines)
{
    Information(
        @"Repository:
        Branch: {0}
        SourceVersion: {1}
        Shelveset: {2}",
        BuildSystem.AzurePipelines.Environment.Repository.Branch,
        BuildSystem.AzurePipelines.Environment.Repository.SourceVersion,
        BuildSystem.AzurePipelines.Environment.Repository.Shelveset
        );
}
else
{
    Information("Not running on Azure Pipelines");
}
if (AzurePipelines.IsRunningOnAzurePipelines)
{
    Information(
        @"Repository:
        Branch: {0}
        SourceVersion: {1}
        Shelveset: {2}",
        AzurePipelines.Environment.Repository.Branch,
        AzurePipelines.Environment.Repository.SourceVersion,
        AzurePipelines.Environment.Repository.Shelveset
        );
}
else
{
    Information("Not running on Azure Pipelines");
}

Value

Type Description
AzurePipelinesRepositoryInfo The Azure Pipelines repository information.