Skip to content

Instantly share code, notes, and snippets.

@amenocal
Created August 23, 2022 16:21
Show Gist options
  • Select an option

  • Save amenocal/218c1b2188e2722351af652d8da68b92 to your computer and use it in GitHub Desktop.

Select an option

Save amenocal/218c1b2188e2722351af652d8da68b92 to your computer and use it in GitHub Desktop.
GraphQL get CheckRuns for latest commit
query FullPullRequestQuery(
$repositoryOwner: String!
$repositoryName: String!
$pullRequestNumber: Int!
) {
repository(owner: $repositoryOwner, name: $repositoryName) {
pullRequest(number: $pullRequestNumber) {
id
state # PR state. For example, { "OPEN", "MERGED", "CLOSED" }
isDraft # Identifies if the pull request is a draft.
headRef {
name # Branch name
target {
oid # Tip SHA of the branch
}
}
number # The PR number (for example: 1083)
repository {
nameWithOwner # For example, "amenocal/reponame"
}
title
url
createdAt
updatedAt
baseRefName
baseRefOid
commits(last: 1) {
nodes {
commit {
oid
pushedDate
checkSuites(last: 20) {
totalCount
nodes {
conclusion
status
url
checkRuns(last: 10) {
totalCount
nodes {
conclusion
name
}
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment