Naveen Kumar
Naveen Kumar

Reputation: 1432

Is there a way to auto approve Pull Request?

I am using Azure DevOps Repo and Build Pipeline and creating Pull Request using Rest API and trying approving it via Rest API by setting vote = 10 but getting below error.

You cannot record a vote for someone else

Is there a way to automate this process.

Upvotes: 1

Views: 2890

Answers (1)

SaiSakethGuduru
SaiSakethGuduru

Reputation: 2440

The pull request status documentation will be helpful in auto approving the pull request. also check the Status API to add custom status to your pull request. Below is the sample pull request status code.

{
    "state": "succeeded",
    "description": "CI build succeeded",
    "context": {
        "name": "my-ci-system",
        "genre": "continuous-integration"
    },
    "targetUrl": "http://contoso.com/CI/builds/1"
}

Here is the related SO threads for pull requests

Upvotes: 4

Related Questions