Skip to content

gh label list --search returning odd results #11979

@gilzow

Description

@gilzow

Describe the bug

using gh label list --search "search-term" returns labels that do not contain "search-term"

Affected version

❯ gh version
gh version 2.82.0 (2025-10-15)

Steps to reproduce the behavior

  1. Type this: gh label list --search "prose" --json name,description
  2. View the output
[
  {
    "description": "",
    "name": "markdown/prose"
  },
  {
    "description": "",
    "name": "automated pr"
  }
]
  1. See error - "automated pr" does not contain the string "prose" and does not contain a single "s" character.

Expected vs actual behavior

In this case I expect only those labels that contain the string "prose" in either the label name or description to be returned. Actual behavior is I'm seeing completely unrelated labels being returned.

Logs

Paste the activity from your command line. Redact if needed.

❯ export GH_DEBUG=true; gh label list --search "prose" --json name,description
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
* Request at 2025-10-20 15:45:58.050019 -0500 CDT m=+0.135239702
* Request to https://api.github.com/graphql
* Request took 460.837393ms
⣾* Request at 2025-10-20 15:45:58.554024 -0500 CDT m=+0.639229895
* Request to https://api.github.com/graphql
⣻* Request took 263.224654ms
[
  {
    "description": "",
    "name": "markdown/prose"
  },
  {
    "description": "",
    "name": "automated pr"
  }
]

I can replicate this behavior by misspelling the search phrase, or by trying other search strings that should match a given number of labels but the actual results contains results that do not contain the search phrase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gh-labelrelating to the gh label commandplatformProblems with the GitHub platform rather than the CLI client

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions