Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Enricher for Azure Pipelines #1675

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/Spectre.Console/Enrichment/CI/AzurePipelinesEnricher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ internal sealed class AzurePipelinesEnricher : IProfileEnricher

public bool Enabled(IDictionary<string, string> environmentVariables)
{
if (environmentVariables.TryGetValue("TF_BUILD", out var value))
{
return value?.Equals("true", StringComparison.OrdinalIgnoreCase) ?? false;
}

return false;
environmentVariables.TryGetValue("TF_BUILD", out var environmentValue);
return string.IsNullOrWhiteSpace(environmentValue);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This expression needs to be inverted, otherwise the enricher will always be enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be updated with the inversion!

}

public void Enrich(Profile profile)
Expand Down