Skip to content

Add --json support to variable get command #9118

Description

@williammartin

Description

With the addition of the variable get command in #9103, users can now get the value of individual variables. However, there is more information returned from these endpoints that might be valuable to expose e.g https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#get-an-organization-variable

{
  "name": "USERNAME",
  "value": "octocat",
  "created_at": "2019-08-10T14:59:22Z",
  "updated_at": "2020-01-10T14:59:22Z",
  "visibility": "selected",
  "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/variables/USERNAME/repositories"
}

The variable list command already supports --json, --jq and --template so we should ensure variable get has parity to maximise scripting potential.

Activity

  1. babakks commented on May 25, 2024

    @babakks
    Member

    @williammartin I've just submitted a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-variablerelating to the gh variable commandhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions