I am writing a server on express js in oder to auto approve pull requests under specific circumstances on Azure DevOps. Here is part of my code :
let connection = new azdev.WebApi(orgUrl, authHandler);
connection.getGitApi().then(gitApi => {
// retrieve PR
gitApi.getPullRequestCommits(repositoryId, pullRequestId).then(result => {
connection.getGitApi().then(git => {
// retrieve all changes of PR
git.getChanges(result[0].commitId, repositoryId).then(result => {
...
}
}
}
}
Now, I check some conditions on the changes and if this conditions are filled, I want to approve the PR. How can I do that? I can not find any API to control the approve or reject of a PR. Thank you in advance.