Skip to content

gh repo list ORG where ORG does not exist, not an error #7231

@ianwilliams1

Description

@ianwilliams1

Describe the bug

When running gh repo list ORG against an ORG that does not exist, no error is thrown, exit code is zero.

Steps to reproduce the behavior

$ gh --version
gh version 2.25.1 (2023-03-21)
https://github.com/cli/cli/releases/tag/v2.25.1

run command for existing org, expect success

$ gh repo list cli >/dev/null
$ echo $?
0

run command for non-existent org, expect failure

$ gh repo list doesnotexit >/dev/null
$ echo $?
0

run command when not logged in, returns error message and non-zero exit code

$ gh repo list cli >/dev/null
To get started with GitHub CLI, please run:  gh auth login
Alternatively, populate the GH_TOKEN environment variable with a GitHub API authentication token.
$ echo $?
4

Expected vs actual behavior

gh repo list ORG where ORG does not exist should return error message and non-zero exit code

Logs

See steps to reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issuehelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions