I am trying to get the Pull request ID (into master) from the commit hash in the build pipeline page. This is needed to list the commit messages and files inside the PR. Is there a way to get it ?
Thanks!
I am trying to get the Pull request ID (into master) from the commit hash in the build pipeline page. This is needed to list the commit messages and files inside the PR. Is there a way to get it ?
Thanks!
You should be able to use the predefined build variable call System.PullRequest.PullRequestId. A list of Azure DevOps build predefined variables can be found here. The documentation states
The ID of the pull request that caused this build. For example: 17. (This variable is initialized only if the build ran because of a Git PR affected by a branch policy).
The following variables are also available
Note: These variables are not available in pipeline templates.