Repository navigation
Support output json gh pr checks #6056
Description
Activity
I'm not opposed to this, but I would want to see a proposal of what the JSON payload would look like.Behind the scenes,gh pr checksis combining data from a few different endpoints. It doesn't cleanly map to a single query with a single JSON payload.The central question is ifgh pr checksshould try and output a single, consistent JSON schema combining the results of action workflow runs and checks or if it should do something like:{ "checks": {}, "runs": {} }with the corresponding payloads for checks and runs.I'm going to mark this asneeds-designand leave it open, but will refrain from encouraging PRs until there is a design consensus.turned out to all be wrong based on out of date knowledge, see followup comment
- addedneeds-designAn engineering task needs design to proceedAn engineering task needs design to proceedand removedneeds-triageneeds to be reviewedneeds to be reviewed
on Aug 11, 2022 I've refreshed myself on the code for
pr checksand remembered that it's now using the status check rollup that combines checks and runs into a single list ^_^()My previous comment can be ignored and I'm ok with a PR that gives the
--jsontreatment to theStatusCheckRolluppayload.Reacted by Shiming ZhangReacted by Shiming Zhang- addedhelp wantedContributions welcomeContributions welcomeand removedneeds-designAn engineering task needs design to proceedAn engineering task needs design to proceed
on Aug 17, 2022 I'm interested to work on this.
As I observe that
gh pr checksalso does some aggregations, I think we should also put this in the JSON payload.My proposed payload:
{ "summary": { "failed": 0, "passed": 1, "pending": 1, "skipping": 1 }, "checkruns": [ { "completedAt": "...", "conclusion": "...", "detailsUrl": "...", "name": "...", "startedAt": "...", "status": "...", "workflowName": "..." } // more checkruns here ] }wdyt?
This would be useful!
Right now if you try to parse the output in a script, e.g. grep for success:
gh pr checks 123 | grep '✓'
...you find out the CLI output changes to instead print tab-separatedpassand the nice emojis are gone.Reacted by Jason MobarakWould it be practical to get check run outputs here too? I'm interested in being able to retrieve why a particular check is failing
hi @redhoyasa, are you still actively working on this?
Reacted by Josef Trejbal
Describe the feature or problem you’d like to solve
Like this
Proposed solution
Additional context