AzureDevOpsAliases.

AzureDevOpsPullRequestUsingAzurePipelinesOAuthToken(ICakeContext, bool) Method

Summary

Gets an Azure DevOps pull request using the settings provided by an Azure Pipelines build. Make sure the build has the 'Allow Scripts to access OAuth token' option enabled.
Assembly
Cake.AzureDevOps.dll
Namespace
Cake.AzureDevOps
Containing Type
AzureDevOpsAliases

Syntax

public static AzureDevOpsPullRequest AzureDevOpsPullRequestUsingAzurePipelinesOAuthToken(this ICakeContext context, bool throwException)

Examples

Get a pull request:

var pullRequest =
    AzureDevOpsPullRequestUsingAzurePipelinesOAuthToken(false);

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute
CakeNamespaceImportAttribute
CakeNamespaceImportAttribute
CakeNamespaceImportAttribute

Parameters

Name Type Description
context ICakeContext The context.
throwException bool Value indicating whether an exception should be thrown if not running in Azure Pipelines or pull request could not be found.

Return Value

Type Description
AzureDevOpsPullRequest Description of the pull request. Returns null if pull request could not be found or if not running in an Azure Pipelines build and throwException is set to false.