有没有一种方法可以从构建中获取跳过的任务列表?
Is there a way by which we can get the list of skipped tasks from the build?
例如,我有2个仅根据外部因素有条件地运行的任务.因此,我如何查看任务是被跳过还是实际从Azure DevOps REST API运行?
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.
任何帮助将不胜感激!
推荐答案您应该查看构建时间轴REST API .如果您发出以下 GET 请求:
You should look into the Build Timeline REST API. If you issue the following GET request:
GET dev.azure/{organization}/{project}/_apis/build/builds/{buildId}/timeline其中 buildId 是您要检查的构建的ID,它返回 Timeline 对象.它本质上是 TimelineRecord 对象,每个对象代表构建时间轴中的一个条目.您应该过滤掉此集合,以仅保留其中"type":"Task" 和"result":"skipped" 的那些.
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".
更多推荐
获取Azure DevOps Pipeline上跳过的任务的列表
发布评论