Repository navigation
Allow --json on the run command #3477
Copy link
Copy link
Closed
Labels
enhancementa request to improve CLIa request to improve CLIhelp wantedContributions welcomeContributions welcome
Description
Activity
- changed the title
[-]Allow `--json` on the runcommand[/-][+]Allow `--json` on the run command[/+]on Apr 21, 2021 We should definitely do this.
@mislav do you want to continue to take point on this type of work or is there enough prior art given the recent release to mark this as
help-wanted?- addedcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributors
on May 18, 2021 I'm marking this
help-wanted.Here's an example of how
release view --jsonhandles exporting data:cli/pkg/cmd/release/view/view.go
Lines 111 to 113 in 4d20aa7
if opts.Exporter != nil { return opts.Exporter.Write(opts.IO.Out, release, opts.IO.ColorEnabled()) } Someone could add this to
run listfunction and pass in the[]shared.Runslice as data to be exported. The final bit would be defining ashared.Run.ExportData()so that a Run object can be converted into data that is to be serialized as JSON for output:cli/pkg/cmd/release/shared/fetch.go
Line 77 in 4d20aa7
func (rel *Release) ExportData(fields []string) *map[string]interface{} { Reacted by Cristian Dominguez, Brendan Kamp and Karuppiah Natarajan- addedhelp wantedContributions welcomeContributions welcomeand removedcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributors
on Jun 18, 2021 I'm working on this.
Reacted by Brendan Kamp, Cameron Davison and Karuppiah NatarajanReacted by Karuppiah Natarajan
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIhelp wantedContributions welcomeContributions welcome
Describe the feature or problem you’d like to solve
Currently the CLI has the ability for the
issuesandpullrequeststo output as json (#385), this is not included in the run commande.g:
gh run list --jsonProposed solution
Giving a structured output that does not need libraries like
awkto pull out the valid data is helpful in many automation cases (i.e see the output of a run to use in an automation script). Adding--jsonwill make this vastly easierAdditional Context
I looked through the current issues and did not find an issue that specifically for this, apologies if I missed one