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

Ignores Organization and uses username instead #697

Closed josemvidal closed 4 years ago

josemvidal commented 4 years ago

Version number

> gh --version
gh 2.1.0

Describe the bug After upgrading, commands inside a repo that belongs to a Github org will try to access the same repo under my username. For example:

> cat .git/config                                                                   
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
[remote "origin"]
    url = git@github.com:SCCapstone/AddMe.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
 ~/ca/re/AddMe   master
> gh is                                                                                  
Listing open issues on josemvidal/AddMe
Error: Error listing issues
HttpError: Not Found
    at Object.run (/usr/local/lib/node_modules/gh/lib/cmds/issue.js:135:19)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)

In the above, the repo belongs at SCCapstone/AddMe, but gh tries to use josemvidal/AddMe and fails, since that is the wrong repo.

BTW, git pull works in this repo.

The repo is private.

This used to work fine a few months back.

To Reproduce

  1. Clone repo from an Org
  2. gh is

Expected behavior

No error message.

protoEvangelion commented 4 years ago

Thanks for the thorough bug report @josemvidal ! Working on it now 😄

protoEvangelion commented 4 years ago

:tada: This issue has been resolved in version 2.1.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

protoEvangelion commented 4 years ago

@all-contributors please add @josemvidal to list of contributors for reporting bug

allcontributors[bot] commented 4 years ago

@protoEvangelion

I've put up a pull request to add @josemvidal! :tada: