Open oprogramador opened 4 years ago
Hey, in case anyone else needs this. You can also query reviews within a pr nodes, please
Query pr statuses
query {
repository(owner:"<org/username>", name:"<repository>") {
pullRequest(number:< pr_number >){
commits(last:1){
nodes{
commit{
status{
state
contexts{
state,
context,
description,
createdAt,
targetUrl
}
}
}
}
}
}
}
}
Query pr reviews
query {
repository(owner:"<org/username>", name:"<repository>") {
pullRequest(number:< pr_number >){
reviews(last:5){
nodes{
state,
url, author{login},
createdAt,
}
}
}
}
}
Query pr statuses and reviews
query {
repository(owner:"<org/name>", name:"<repository>") {
pullRequest(number:<pr_number>){
reviews(last:5){
nodes{
state,
url, author{login},
createdAt,
}
}
commits(last:1){
nodes{
commit{
status{
state
contexts{
state,
context,
description,
createdAt,
targetUrl
}
}
}
}
}
}
}
}
Thanks @kevinmukuna
At this moment, I don't need this but when I check the commit build status with v4 API in the future, maybe I'll tell whether your solution works.
How can I check the status (success/ failure/ pending) for the last commit of the default branch for a given repo, using the GraphQL API?
In the v3 API I can do this: