This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.AzureDevOps.
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 |
---|---|
Cake |
|
Cake |
|
Cake |
|
Cake |
|
Cake |
Parameters
Name | Type | Description |
---|---|---|
context | ICakeContext | The context. |
settings | Azure |
Settings for accessing the pull request. |
Return Value
Type | Description |
---|---|
IEnumerable |
The commits contained in the pull request.
Returns an empty list if pull request could not be found and
ThrowExceptionIfPullRequestCouldNotBeFound is set to false . |