node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.
http://nodegh.io
Other
1.71k stars 217 forks source link

Cannot run `gh pr` outside of a git repository for a different account #619

Closed mtyurt closed 5 years ago

mtyurt commented 5 years ago

What happened? I'm using gh outside of a git repository, i.e. polling the open pull requests for a dashboard. I cannot fetch pull request information on another account than mine.

$ gh --version
gh 1.13.9
$ gh pr --list --remote node-gh --repo gh
Listing open pull requests on mtyurt/gh
warning: Can't list pull requests for mtyurt/gh
$ gh pr --remote node-gh --repo gh -l
Listing open pull requests on mtyurt/gh
warning: Can't list pull requests for mtyurt/gh
$ gh pr --list --org node-gh --remote node-gh --repo gh
Listing open pull requests on mtyurt/gh
warning: Can't list pull requests for mtyurt/gh

What is expected? I understand remote should be the same as remote names in a repository. However, I would expect to run a command outside of my git repository directory with proper repo names:

$ gh pr -l --repo node-gh/gh
protoEvangelion commented 5 years ago

Hey @mtyurt have you tried gh pr -u node-gh -r gh or gh pr --user node-gh --repo gh?

mtyurt commented 5 years ago

@protoEvangelion thank you, that command works. It might make sense to add an example like this to the documentation, considering that flags don't have any explanation :) First I saw it, I thought it was filtering the pull requests for given user, not the account name.

protoEvangelion commented 5 years ago

Great suggestion @mtyurt Now that I think about it, it is unclear the difference between --repo, --user and --remote. I will open a new issue with that suggestion 👍