This repository was archived by the owner on Nov 18, 2021. It is now read-only.
support for ssh-key-less upload#28
Open
anaderi wants to merge 1 commit into
Open
Conversation
rninne
suggested changes
Oct 4, 2017
| child.exec("git remote add --track master " + quote.single(argv.remote) + " git@gist.github.com:" + id + ".git", function(error, stdout, stderr) { | ||
| function gitRemoteAdd(id, settings, callback) { | ||
| url = "git@gist.github.com:" + id + ".git"; // default | ||
| if (/^https$/i.test(settings.protocol)) url = "https://" + settings.user + ":" + settings.token + "@gist.github.com/" + id + ".git"; |
There was a problem hiding this comment.
settings.user is not needed, you can simply construct the URL as: https://TOKEN@gist.github.com
|
+1 for adding the https protocol. Having 2fa on your account also restricts using ssh without the ssh passphrase. This solution works well with 2fa enabled. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ssh key for upload gist is a bit of luxury in CI (travis) environment. and actually it is not needed, since we have API token. so if user specifies 'protocol' in config file to be 'https', gistup will be able to upload the contents just by https after applying the PR.