Skip to content

gh release list --limit 0 loops infinitely #13078

@zhangyoufu

Description

@zhangyoufu

Describe the bug

gh release list --limit 0 loops infinitely, without rejecting invalid argument value.

Other subcommands reject invalid --limit argument.

% gh codespace list --limit 0
invalid limit: 0
% gh gist list --limit 0
invalid limit: 0
% gh issue list --limit 0
invalid limit: 0
% gh org list --limit 0
invalid limit: 0
% gh pr list --limit 0
invalid value for --limit: 0
% gh repo list --limit 0
invalid limit: 0
% gh run list --limit 0
invalid limit: 0
% gh workflow list --limit 0
invalid limit: 0

Affected version

gh version 2.89.0 (2026-03-26)
https://github.com/cli/cli/releases/tag/v2.89.0

Steps to reproduce the behavior

run gh release list --limit 0

Expected vs actual behavior

expected: invalid limit: 0
actual: GitHub CLI busy looping hitting GraphQL

Logs

% GH_DEBUG=1 gh release list --limit 0
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
* Request at 2026-04-02 17:13:22.54473 +0800 CST m=+0.102956417
* Request to https://api.github.com/graphql
* Request took 1.109127125s
* Request at 2026-04-02 17:13:23.694237 +0800 CST m=+1.252464501
* Request to https://api.github.com/graphql
* Request took 1.193ms
* Request at 2026-04-02 17:13:23.720473 +0800 CST m=+1.278700667
* Request to https://api.github.com/graphql
* Request took 426.347709ms
* Request at 2026-04-02 17:13:24.18102 +0800 CST m=+1.739247334
* Request to https://api.github.com/graphql
^C

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggh-releaserelating to the gh release commandpriority-3Affects a small number of users or is largely cosmetic

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions