diff --git a/src/Cake.AzureDevOps/AzureDevOpsAliases.Pipelines.cs b/src/Cake.AzureDevOps/AzureDevOpsAliases.Pipelines.cs
index b5f9257e..20769ac6 100644
--- a/src/Cake.AzureDevOps/AzureDevOpsAliases.Pipelines.cs
+++ b/src/Cake.AzureDevOps/AzureDevOpsAliases.Pipelines.cs
@@ -89,6 +89,42 @@ public static partial class AzureDevOpsAliases
return AzureDevOpsBuild(context, settings);
}
+ ///
+ /// Gets the description of the Azure Pipelines build which is running.
+ /// Make sure the build has the 'Allow Scripts to access OAuth token' option enabled.
+ ///
+ /// The context.
+ /// Value indicating whether an exception
+ /// should be thrown if build could not be found.
+ ///
+ /// Get current Azure Pipelines build. Don't throw exception in case the build is not found:
+ ///
+ ///
+ ///
+ ///
+ /// Description of the build.
+ /// Returns null if build could not be found and
+ /// is set to false.
+ /// If build could not be found and
+ /// is set to true.
+ [CakeMethodAlias]
+ [CakeAliasCategory("Azure Pipelines")]
+ [CakeNamespaceImport("Cake.AzureDevOps.Pipelines")]
+ public static AzureDevOpsBuild AzureDevOpsBuildUsingAzurePipelinesOAuthToken(
+ this ICakeContext context,
+ bool throwExceptionIfBuildCouldNotBeFound)
+ {
+ context.NotNull(nameof(context));
+
+ var settings = AzureDevOpsBuildSettings.UsingAzurePipelinesOAuthToken();
+ settings.ThrowExceptionIfBuildCouldNotBeFound = throwExceptionIfBuildCouldNotBeFound;
+
+ return AzureDevOpsBuild(context, settings);
+ }
+
///
/// Gets the description of a specific build which is running the access token provided by Azure Pipelines.
/// Make sure the build has the 'Allow Scripts to access OAuth token' option enabled.
@@ -100,7 +136,7 @@ public static partial class AzureDevOpsAliases
///
///
///
///
@@ -124,6 +160,45 @@ public static partial class AzureDevOpsAliases
return AzureDevOpsBuild(context, settings);
}
+ ///
+ /// Gets the description of a specific build which is running the access token provided by Azure Pipelines.
+ /// Make sure the build has the 'Allow Scripts to access OAuth token' option enabled.
+ ///
+ /// The context.
+ /// ID of the build.
+ /// Value indicating whether an exception
+ /// should be thrown if build could not be found.
+ ///
+ /// Get an Azure Pipelines build. Don't throw exception in case the build is not found:
+ ///
+ ///
+ ///
+ ///
+ /// Description of the build.
+ /// Returns null if build could not be found and
+ /// is set to false.
+ /// If build could not be found and
+ /// is set to true.
+ [CakeMethodAlias]
+ [CakeAliasCategory("Azure Pipelines")]
+ [CakeNamespaceImport("Cake.AzureDevOps.Pipelines")]
+ public static AzureDevOpsBuild AzureDevOpsBuildUsingAzurePipelinesOAuthToken(
+ this ICakeContext context,
+ int buildId,
+ bool throwExceptionIfBuildCouldNotBeFound)
+ {
+ context.NotNull(nameof(context));
+ buildId.NotNegativeOrZero(nameof(buildId));
+
+ var settings = AzureDevOpsBuildSettings.UsingAzurePipelinesOAuthToken(buildId);
+ settings.ThrowExceptionIfBuildCouldNotBeFound = throwExceptionIfBuildCouldNotBeFound;
+
+ return AzureDevOpsBuild(context, settings);
+ }
+
///
/// Gets Azure Pipelines builds using the specified settings.
///