The Cake.AzureDevOps addin provides an alias for approving or voting on pull requests.
The following example will approve a pull request on an Azure DevOps Server:
#addin "Cake.AzureDevOps"
Task("Vote-PullRequest").Does(() =>
{
var pullRequestSettings =
new AzureDevOpsPullRequestSettings(
new Uri("http://myserver:8080/defaultcollection/myproject/_git/myrepository"),
"refs/heads/feature/myfeature",
AzureDevOpsAuthenticationNtlm());
AzureDevOpsVotePullRequest(
pullRequestSettings,
AzureDevOpsPullRequestVote.Approved);
});