Skip to content

gh secret set fails if repository name contains '-' with 'GraphQL error: Parse error on "-"' #2829

@teppey

Description

@teppey

Describe the bug

When adding a secret for organization with the gh secret set command, an error will occur if the name of the selected repository name contains '-'.

$ gh --version
gh version 1.5.0 (2021-01-21)
https://github.com/cli/cli/releases/tag/v1.5.0

Steps to reproduce the behavior

  1. Add repository(A) with a name that includes '-' to organization(B)
  2. Execute the following command: gh secret set foo -bbar --org=B --repos=A
  3. See error

Expected vs actual behavior

Secret is added to the organization with visibility of the selected repository.

Logs

$ gh secret set foo -bbar --org=<org> --repos=<repo>
failed to set secret: failed to look up IDs for repositories [<repo>]: failed to look up repositories: GraphQL error: Parse error on "-" (error) at [2, 10]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-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