Skip to content

The gh issue create command fails if multiple labels are specified and there is a space after the comma separating labels #11898

@mrememisaac

Description

@mrememisaac

Describe the bug

gh issue create fails if multiple labels are specified and there is a space after the comma separating labels. It expects there should be no space only a comma separating labels. If it finds a space it takes the space to be part of the label and thus fails to create the issue

Affected version

2.4.0+dfsg1 (2022-03-23 Ubuntu 2.4.0+dfsg1-2)

Steps to reproduce the behavior

  1. Type this 'h issue create --title "Add Prettier as dev dependency and format script" --body "Add Prettier as a dev dependency and add a format script to standardize project formatting." --label "chore, tooling"
  2. View the output 'could not add label: ' tooling' not found'
  3. See error

Expected vs actual behavior

Expected: The content of the label flag should be split by comma and then trimmed before being compared with the existing labels list.
Actual: The content are not trimmed, they are used as is.

Logs

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

NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-issuerelating to the gh issue commandgh-prrelating to the gh pr commandgh-searchrelating to the gh search commandneeds-triageneeds to be reviewedstale

    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