Describe the bug
The command echo foo | DEBUG=api gh pr comment "$pr_id" --body - adds the comment with - symbol only.
Affected version
Please run gh version and paste the output below:
$ gh --version
gh version 2.83.0 (2025-11-11)
https://github.com/cli/cli/releases/tag/v2.83.0
Steps to reproduce the behavior
- Type this
echo foo | DEBUG=api gh pr comment <PR-NUMBER> --body -
- Check the comment in PR.
Expected vs actual behavior
A comment with text foo added to a PR.
Logs
Paste the activity from your command line. Redact if needed.
GraphQL query:
mutation CommentCreate($input:AddCommentInput!){addComment(input: $input){commentEdge{node{url}}}}
GraphQL variables: {"input":{"subjectId":"PR_kwDOBSdkQM6ypkfz","body":"-"}}
Describe the bug
The command
echo foo | DEBUG=api gh pr comment "$pr_id" --body -adds the comment with-symbol only.Affected version
Please run
gh versionand paste the output below:Steps to reproduce the behavior
echo foo | DEBUG=api gh pr comment <PR-NUMBER> --body -Expected vs actual behavior
A comment with text
fooadded to a PR.Logs
Paste the activity from your command line. Redact if needed.