IBuildAgent Interface

Summary

Represents a CI/CD build agent integration that GitVersion can write version information to.
Namespace
GitVersion.Agents
Implementing Types
graph BT Type["IBuildAgent"] class Type type-node Implementing0["ICurrentBuildAgent"]-.->Type click Implementing0 "/api/GitVersion.Agents/ICurrentBuildAgent"

Syntax

public interface IBuildAgent

Properties

Name Value Summary
IsDefault bool
Gets a value indicating whether this agent is the default fallback when no specific agent is detected.

Methods

Name Value Summary
CanApplyToCurrentContext() bool
Determines whether this build agent is active in the current execution context.
GetCurrentBranch(bool) string
Returns the name of the current branch as reported by the build agent environment.
PreventFetch() bool
Indicates whether fetching from the remote should be suppressed in this build agent environment.
ShouldCleanUpRemotes() bool
Indicates whether remote tracking branches should be cleaned up after fetching.
WriteIntegration(Action<string>, GitVersionVariables, bool) void
Writes the computed version variables to the build agent's integration output (e.g. environment variables or build properties).

Extension Methods

Name Value Summary
NotNull<IBuildAgent>(string) T
Throws ArgumentNullException when value is null; otherwise returns the value.
GitHub