获取Azure DevOps Pipeline上跳过的任务的列表 [英] Get the list of skipped tasks on Azure DevOps Pipeline
问题描述
有没有一种方法可以从构建中获取跳过的任务列表?
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.
任何帮助将不胜感激!
推荐答案
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
其中 buildId
是您要检查的构建的ID,它返回 Timeline
对象.它本质上是和"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上跳过的任务的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!