How to write a GraphQL query to retrieve all the workflows/runs from github I tried below query for to get node id
organization(login: "abc") {
        repositories(first: 100) {
            nodes {
                    id
                    name
                    }
                }
            }
and below query to get workflow.
    nodes(ids: "sdefrgrt") {
        ... on Workflow {
          id
          createdAt
          name
          updatedAt
        }
}
                You may get the workflow runs via:
     {
      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
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
Workflow's node_id could be taken from https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#get-a-workflow
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With