Skip to content

ngh doesn't seem to recognize GH_TOKEN #20

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

Closed
RobertPaulson90 opened this issue May 25, 2017 · 6 comments
Closed

ngh doesn't seem to recognize GH_TOKEN #20

RobertPaulson90 opened this issue May 25, 2017 · 6 comments
Labels

Comments

@RobertPaulson90
Copy link

RobertPaulson90 commented May 25, 2017

My personal job log from a failed deployment.
My personal .travis.yml from this specific project

I'm pretty sure I've setup the environment variable on Travis correctly, including the token permissions. Am I missing something silly, or is there a potential bug?

@RobertPaulson90
Copy link
Author

RobertPaulson90 commented May 25, 2017

I'm not too bright - the error was right there in the job log. Git user details needed to be properly configured. My bad!

@RobertPaulson90
Copy link
Author

RobertPaulson90 commented May 25, 2017

Oh, it still fails even with git configured

@JohannesHoppe
Copy link
Member

The message in the log is pretty clear:

message: 'remote: Invalid username or password.\nfatal: Authentication failed for 'https://github.com/amivit/RSMuseum-ng.git/\'\n',

The configured username and password will make your git history pretty. They do not have any influence to the authentication to github.

Please see this:
image
Travis has no rights to WRITE to your github repos (that's good!).

It will be a bit complicated to change the global git configuration to use another account. I never tried that for travis. The easiest solution is the following:

  1. Please create a GH_TOKEN as described here:
    https://github.com/blog/1509-personal-api-tokens
    image

  2. Set the Travis Environment variable GH_TOKEN.

  3. Execute ngh --repo=https://[email protected]/amivit/RSMuseum-ng.git --name="Name just for history" [email protected]

@RobertPaulson90
Copy link
Author

Ohhh, I believe I misunderstood this and though ngh would automatically recognize the GH_TOKEN env var (that IS present). But I actually have to include "GH_TOKEN" within the --repo option. I didn't do that and was just executing ngh. Let me try again.

@JohannesHoppe
Copy link
Member

Yes, it recognizes the GH_TOKEN env var and replaces the same string in the URL. No magic here! ;-)

@RobertPaulson90
Copy link
Author

Yeah it works perfect now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants