Skip to content

Commit

Permalink
Adding Enricher for Azure Pipelines (#1675)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlazeFace authored Nov 4, 2024
1 parent fdc03f2 commit a87277e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Spectre.Console/Enrichment/CI/AzurePipelinesEnricher.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Spectre.Console.Enrichment;

internal sealed class AzurePipelinesEnricher : IProfileEnricher
{
public string Name => "AzurePipeline";

public bool Enabled(IDictionary<string, string> environmentVariables)
{
environmentVariables.TryGetValue("TF_BUILD", out var environmentValue);
return !string.IsNullOrWhiteSpace(environmentValue);
}

public void Enrich(Profile profile)
{
profile.Capabilities.Ansi = true;
profile.Capabilities.Legacy = false;
profile.Capabilities.Interactive = false;
profile.Capabilities.Links = false;
}
}
1 change: 1 addition & 0 deletions src/Spectre.Console/Enrichment/ProfileEnricher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ internal static class ProfileEnricher
private static readonly List<IProfileEnricher> _defaultEnrichers = new List<IProfileEnricher>
{
new AppVeyorEnricher(),
new AzurePipelinesEnricher(),
new BambooEnricher(),
new BitbucketEnricher(),
new BitriseEnricher(),
Expand Down

0 comments on commit a87277e

Please sign in to comment.