Skip to content

Putting a comment on an issue doesnt work if that issue is a PR #4127

@maniator

Description

@maniator

Describe the bug

A clear and concise description of what the bug is. Include version by typing gh --version.

❯ gh --version
gh version 1.14.0 (2021-08-04)
https://github.com/cli/cli/releases/tag/v1.14.0

Steps to reproduce the behavior

  1. Create a PR on a repo, and also create an issue
  2. See that the numbers come out in order (1, then 2 etc)
  3. Try to do:
    • gh issue comment -b hello 1
      • You get an error saying: GraphQL error: Could not resolve to an Issue with the number of 1.
    • Try the same thing with 2 instead of one and it works fine

Expected vs actual behavior

What was expected is that using the issue API (through the cli) should allow you to post a comment on a PR or an issue (same as the regular github api REST api)

The reason for this is that the action issue_comment on github actions does not tell you if that issue was a pull request or an actual github issue, and we still need to have the ability to post a comment to both without having to run one on error and then switch to using gh pr comment ...

Logs

❯ gh  issue comment -b hello 194
GraphQL error: Could not resolve to an Issue with the number of 194.
❯ gh pr comment -b hello 194
https://github.com/serveside/serveside/pull/194#issuecomment-898608949
❯ gh --version
gh version 1.14.0 (2021-08-04)
https://github.com/cli/cli/releases/tag/v1.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions