Summary
Represents a CI/CD build agent integration that GitVersion can write version information to.
- Assembly
- GitVersion
.Core .dll - 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
Attributes
| Type | Description |
|---|---|
| Nullable |
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 |
|---|---|---|
| Can |
bool |
Determines whether this build agent is active in the current execution context.
|
| GetCurrentBranch |
string |
Returns the name of the current branch as reported by the build agent environment.
|
| GetCurrentTag |
string |
Returns the canonical tag reference explicitly selected by the build agent environment, or null for other builds.
|
| 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 |
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 |
T |
Throws
System.ArgumentNullException when value is null; otherwise returns the value.From CommonExtensions
|