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

Error cloning when using GitHub Enterprise #651

Closed aaronkjones closed 4 years ago

aaronkjones commented 5 years ago

Output shows that it is using github.company.com, but then uses github.com in clone command DEBUG: spawnSyncStream: git clone git@github.com:user/DemoRepo.git DemoRepo

Output

gh re -c -r DemoRepo --verbose
DEBUG: ENOENT: no such file or directory, open '/Users/user/Documents/GitHub/.gh.json'
DEBUG: spawnSync: git config --get remote.origin.url
DEBUG: Can't get remote URL.
DEBUG: spawnSync: git symbolic-ref --short HEAD
DEBUG: Can't get current branch.
https://github.company.com/user/DemoRepo
Cloning user/DemoRepo
DEBUG: spawnSyncStream: git clone git@github.com:user/DemoRepo.git DemoRepo
Cloning into 'DemoRepo'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
/usr/local/lib/node_modules/gh/lib/exec.js:38
        throw err;
        ^

Error: Child process terminated with error code 128
    at Object.spawnSyncStream (/usr/local/lib/node_modules/gh/lib/exec.js:35:15)
    at Object.clone (/usr/local/lib/node_modules/gh/lib/git.js:25:29)
    at Repo.clone_ (/usr/local/lib/node_modules/gh/lib/cmds/repo.js:298:9)
    at /usr/local/lib/node_modules/gh/lib/cmds/repo.js:123:30
    at /usr/local/lib/node_modules/gh/lib/base.js:96:28
    at /usr/local/lib/node_modules/gh/node_modules/github/api/v3.0.0/repos.js:319:17
    at callCallback (/usr/local/lib/node_modules/gh/node_modules/github/index.js:743:17)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/gh/node_modules/github/index.js:796:25)
    at IncomingMessage.emit (events.js:208:15)
    at endReadableNT (_stream_readable.js:1161:12) {
  code: 128,
  message: 'Child process terminated with error code 128'
}

Config

    "api": {
        "host": "github.company.com",
        "protocol": "https",
        "version": "3.0.0",
        "pathPrefix": "/api/v3"
    },
protoEvangelion commented 5 years ago

Hey @aaronkjones that definitely looks like an issue! I will make a note to look into this.

protoEvangelion commented 4 years ago

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

The release is available on:

Your semantic-release bot :package::rocket:

aaronkjones commented 4 years ago

Thank you @protoEvangelion