MicrosoftDocs / vsts-rest-api-specs

MIT License
166 stars 115 forks source link

API to get all builds based on repo/branch #599

Closed lipalath-ms closed 1 year ago

lipalath-ms commented 1 year ago

I followed this doc: https://learn.microsoft.com/en-us/rest/api/azure/devops/build/builds/list?view=azure-devops-rest-7.0&source=docs to list all builds from a repository from a branch:

$parentUrl = "https://dev.azure.com/{organization}/{project}/_apis/build/builds?repository.type=TfsGit&repository.id=repoid&branchName=refs/heads/develop&api-version=6.0"
$parentData = Invoke-RestMethod -Uri $parentUrl -ContentType 'application/json' -Headers $headers -Method GET 

The issue I see is that the api is returning the builds that are not in my repository when the branchName is refs/heads/develop or refs/heads/main. Is this some known bug?


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

nechvatalp commented 1 year ago

Closing as duplicate of #600