Getting status of checks run on a specific commit #46
Unanswered
carolinascarneiro
asked this question in
Q&A
Replies: 1 comment
-
It's been a while since I checked, maybe there is a simpler way, but this is the GraphQL query fragment for a commit I used in the past oid
checkSuites(first: 100) {
nodes {
checkRuns(first: 100) {
nodes {
name
conclusion
permalink
}
}
}
}
status {
state
contexts {
state
targetUrl
description
context
}
} you then have to reduce the graphql response to the result you want. with something like this const statuses = commit.status ? commit.status.contexts : [];
const unsuccessStatuses = statuses.filter(
(status) => status.state !== "SUCCESS"
);
const unsuccessfulCheckRuns = checkRuns
.filter(
(checkRun) =>
checkRun.conclusion !== "SUCCESS" &&
checkRun.conclusion !== "NEUTRAL" &&
checkRun.conclusion !== null
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm trying to get the status of the checks made on a certain commit thorugh GitHub Actions just as they're shown on the GitHub Web UI.
I already tried getting the combined status for a specific reference, which is a specific SHA number (https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#get-the-combined-status-for-a-specific-reference) and listing commit statuses List commit statuses for a reference for a specific SHA, and using Octokit for doing it, but both of them return something different than what is shown on the GitHub Repo Web UI:
How do I get exactly what is on this image? Also requests with GH CLI and Curl did not work. I also tried check runs and check suites and also them returned something completely different.
Thank you so much.
Beta Was this translation helpful? Give feedback.
All reactions