Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private repositories #24

Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

Copy link

Is there a way to fetch templates from a private repo? Is it possible to do so from a batch process? I saw #2 mentioned this, but it looks like that ticket was closed without being implemented.

Copy link
Author

Degit appears to fetch via https, so I tried this workaround:

git config --global credential.helper store
echo https://foo:${PAT}@github.com > ~/.git-credentials
npx ghat user/repo/file.yaml

(I also tried with --mode=git.)

With this config, ghat didn't prompt for credentials. The output I received was:

(node:8523) UnhandledPromiseRejectionWarning: Error: could not download https://github.com/user/repo/archive/deadbeefdeadbeef.tar.gz
    at Degit._cloneWithTar (/root/.npm/_npx/8523/lib/node_modules/ghat/dist/index.js:15361:10)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Degit.clone (/root/.npm/_npx/8523/lib/node_modules/ghat/dist/index.js:15157:4)
    at async ghat (/root/.npm/_npx/8523/lib/node_modules/ghat/dist/index.js:190:2)
    at async /root/.npm/_npx/8523/lib/node_modules/ghat/dist/index.js:31:4
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8523) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8523) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I think this means that ghat ignores the unknown --mode flag, and degit isn't able to clone the private repo via HTTPS, even though it receives credentials from Git.

Copy link
Author

Not sure if this is useful, but it looks like degit has a fork that's more actively maintained: Rich-Harris/degit#258.

@fregante fregante added enhancement New feature or request help wanted Extra attention is needed labels May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants