问题
Is there a way by which we can get the list of skipped tasks from the build?
For example, I have 2 tasks that run conditionally only based on external factors. So how can I see, whether the tasks were skipped or actually ran from Azure DevOps REST API?
I need to trigger another build conditionally based on the above factor.
Any help will be appreciated!
回答1:
You should look into the Build Timeline REST API. If you issue the following GET
request:
GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/timeline
where buildId
is the ID of the build you're examining, it returns the Timeline
object. It is essentially a collection of TimelineRecord objects, each representing an entry in a build's timeline. You should filter out this collection to leave only those, where "type": "Task"
and "result": "skipped"
.
来源:https://stackoverflow.com/questions/58706951/get-the-list-of-skipped-tasks-on-azure-devops-pipeline