Skip to content

ngh doesn't seem to recognize GH_TOKEN #20

Closed

Description

@RobertPaulson90

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?

Activity

  1. RobertPaulson90 commented on May 25, 2017

    @RobertPaulson90
    Author

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

  2. RobertPaulson90 commented on May 25, 2017

    @RobertPaulson90
    Author

    Oh, it still fails even with git configured

  3. JohannesHoppe commented on May 26, 2017

    @JohannesHoppe
    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://GH_TOKEN@github.com/amivit/RSMuseum-ng.git --name="Name just for history" --email=mail_just_for_the_history@example.org

  4. RobertPaulson90 commented on May 26, 2017

    @RobertPaulson90
    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.

  5. JohannesHoppe commented on May 26, 2017

    @JohannesHoppe
    Member

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

  6. RobertPaulson90 commented on May 26, 2017

    @RobertPaulson90
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions