Skip to content

Commit 265a1e1

Browse files
authored
Merge pull request #262 from christianbumann/feature/gh-261
GH-261) Add FinishTime property to AzureDevOpsBuild
2 parents d5d7d7b + 9c79fab commit 265a1e1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuild.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,26 @@ public AzureDevOpsBuildResult? Result
292292
}
293293
}
294294

295+
/// <summary>
296+
/// Gets the finish time of the build.
297+
/// Returns <c>null</c> if no build could be found and
298+
/// <see cref="AzureDevOpsBuildSettings.ThrowExceptionIfBuildCouldNotBeFound"/> is set to <c>false</c>.
299+
/// </summary>
300+
/// <exception cref="AzureDevOpsBuildNotFoundException">If build could not be found and
301+
/// <see cref="AzureDevOpsBuildSettings.ThrowExceptionIfBuildCouldNotBeFound"/> is set to <c>true</c>.</exception>
302+
public DateTime? FinishTime
303+
{
304+
get
305+
{
306+
if (!this.ValidateBuild())
307+
{
308+
return null;
309+
}
310+
311+
return this.build.FinishTime;
312+
}
313+
}
314+
295315
/// <summary>
296316
/// Gets the parameters passed to the build.
297317
/// Returns an empty dictionary if no build could be found and

0 commit comments

Comments
 (0)