如何编写 GraphQL 查询以从 github 检索所有工作流程/运行
我尝试下面的查询来获取节点 id
organization(login: "abc") {
repositories(first: 100) {
nodes {
id
name
}
}
}
和下面的查询来获取工作流程。
nodes(ids: "sdefrgrt") {
... on Workflow {
id
createdAt
name
updatedAt
}
}
您可以通过以下方式运行工作流程:
{
node(id: "YOUR-WORKFLOW-NODE-ID") {
... on Workflow {
runs(first: 10) {
nodes {
runNumber
createdAt
checkSuite {
commit {
message
associatedPullRequests(first: 1) {
nodes {
number
}
}
history {
nodes {
author {
date
email
name
}
}
}
}
}
}
}
}
}
}
工作流的node_id可以取自https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#get-a-workflow https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#get-a-workflow
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)