AzureDevOpsAliases.

AzureDevOpsGetPullRequestCommits(ICakeContext, AzureDevOpsPullRequestSettings) Method

Summary

Gets the commits contained in the Azure DevOps pull request using the specified settings.
Assembly
Cake.AzureDevOps.dll
Namespace
Cake.AzureDevOps
Containing Type
AzureDevOpsAliases

Syntax

public static IEnumerable<AzureDevOpsCommit> AzureDevOpsGetPullRequestCommits(this ICakeContext context, AzureDevOpsPullRequestSettings settings)

Examples

Lists id and message of commits of a pull request:

 var pullRequestSettings =
     new AzureDevOpsPullRequestSettings(
         new Uri("http://myserver:8080/defaultcollection/myproject/_git/myrepository"),
         "refs/heads/feature/myfeature",
         AzureDevOpsAuthenticationNtlm());

 var commits =
     AzureDevOpsGetPullRequestCommits(
         pullRequestSettings);

 Information("Commits");
 foreach (var commit in commits)
 {
     Information("  {0}: {1}", commit.Id, commit.Message);
 }

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute
CakeNamespaceImportAttribute
CakeNamespaceImportAttribute
CakeNamespaceImportAttribute

Parameters

Name Type Description
context ICakeContext The context.
settings AzureDevOpsPullRequestSettings Settings for accessing the pull request.

Return Value

Type Description
IEnumerable<AzureDevOpsCommit> The commits contained in the pull request. Returns an empty list if pull request could not be found and ThrowExceptionIfPullRequestCouldNotBeFound is set to false.