获取Azure DevOps Pipeline上跳过的任务的列表

编程入门 行业动态 更新时间:2024-10-17 09:49:44
本文介绍了获取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.

任何帮助将不胜感激!

推荐答案

您应该查看构建时间轴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上跳过的任务的列表

本文发布于:2023-11-24 04:45:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624019.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:跳过   列表   Azure   DevOps   Pipeline

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!