Skip to content

Add explicit fields to test other repository visibility options #7310

@yeikel

Description

@yeikel

Describe the feature or problem you’d like to solve

In GHE there are three options for the repository visibility

  • public
  • internal
  • private

I'd like to be able to extract and validate the visibility of the repository. With the current isPrivate I can only tell if it is private or public but not if it is internal

Proposed solution

Add dedicated json fields to extend the existing isPrivate field

gh repo view repo --json isPrivate
gh repo view repo --json isInternal
gh repo view repo --json isPublic

Alternatively,

The github api returns a visibility field

And it is possible to do this

gh api repo --jq .visibility

Additional context

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions