Home > other >  working on an automation to approve the Pull Request from Logic App Flow
working on an automation to approve the Pull Request from Logic App Flow

Time:02-03

I am working on automating the approval process of a Pull request(in Azure DevOps) using Logic app. I have already built the flow with few conditions to meet and then the flow has to approve the PR automatically if the conditions are met.

Need suggestion on which action/trigger will approve the Pull request automatically? enter image description here

CodePudding user response:

Maybe look at using the relevant REST API ...

https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/update

You can see there are a couple of fields in the payload you'll need to pay attention to, vote being one of them and status being the other.

You'll need to authenticate and to do that, it'll be a matter of picking one of the auth methods listed here ...

https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/authentication-guidance?view=azure-devops

PAT is typically the easiest but be sure to restrict it's access in case the key is compromised.

Now having said that, there is a very specific section on auth which you'll need to make sure you adhere to.

https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/update?view=azure-devops-rest-7.0#security

  • Related