gpt4 book ai didi

Using Github Actions REST API, how to correlate reruns to the original run similar to the UI?(使用Github Actions REST API,如何将重新运行与类似于UI的原始运行关联起来?)

转载 作者:bug小助手 更新时间:2023-10-25 18:47:06 33 4
gpt4 key购买 nike



I'm trying to get all recent runs in my repo on a specific branch. I then want to be able to correlate them.

我正在试着在我的回购中得到某一特定分支机构最近的所有运行记录。然后我希望能够将它们联系起来。


Example

Lets say I have 5 runs(01,02,03,04,05), 01-03 are fresh runs, 04 is rerun of 01 and 05 is rerun of 03.

例如,假设我有5次运行(01,02,03,04,05),01-03是新运行,04是01的重新运行,05是03的重新运行。


How can I detect these rerun relations, similarly to how they're grouped in the UI dropdown?

我如何检测这些重新运行的关系,就像它们在UI下拉列表中的分组方式一样?


更多回答
优秀答案推荐

We can discover the desired relation between workflow runs using the /repos/{owner}/{repo}/actions/runs API. We will get workflow runs for the current repository. According to the response, the JSON contains workflow_runs array. Each workflow item contains previous_attempt_url property pointing to a previous run. If a particular run has no rerun attempt the property will be null. You can use the property to build a rerun tree.

我们可以使用/repos/{Owner}/{repo}/Actions/Runs API发现工作流运行之间所需的关系。我们将为当前存储库运行工作流。根据响应,JSON包含WORKFLOW_RUNS数组。每个工作流项都包含指向上一次运行的precent_tempt_url属性。如果特定运行没有重新运行尝试,则该属性将为空。您可以使用该属性构建重新运行树。


更多回答

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com