获取Azure DevOps Pipeline上跳过的任务的列表 [英] Get the list of skipped tasks on Azure DevOps Pipeline

查看:59
本文介绍了获取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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆