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

Not able to authenticate using Github Enterprise version #981

Open
swaprenge opened this issue May 7, 2022 · 10 comments
Open

Not able to authenticate using Github Enterprise version #981

swaprenge opened this issue May 7, 2022 · 10 comments

Comments

@swaprenge
Copy link

swaprenge commented May 7, 2022

Not able to authenticate using Github Enterprise version
A clear and concise description of what the bug is.
I setup shipjs and configured github token in my Github Enterprise account.
While running the yarn run release
after running some checks, one of the step is Authentication, which opens github sign in page.
But my repository is under the github enterprise version.
How can I authenticate using Github enterprise version?

To Reproduce
Steps to reproduce the behavior:

  1. Run yarn run release
  2. Wait till github authentication prompts open.
  3. Try to enter the token created under the Github Enterprise account.

Expected behavior
Authentication should be successful and should be able to create release branch under the Github enterprise repository.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • environment: (your local machine, CircleCI, Travis CI, etc.) local machine
  • node -v: v.12.18.1
  • npm -v or yarn -v : yarn v3.2.0
  • Ship.js version: 0.24.4

Additional context
NA

@eunjae-lee
Copy link
Contributor

Hello @swaprenge
Thanks for trying out Ship.js. Do you have GITHUB_TOKEN environment variable in .env file? I do not have experience with GH Enterprise account. It'd be much helpful if you could provide screenshots or error messages if any.

Or, you could have a cron job in the GitHub Action to run yarn run release periodically (like every week). Then I guess GH Action will take care of the authentication process as well. But you may want to run yarn run release manually. So I'd appreciate if you could provide more information. Thanks!

@swaprenge
Copy link
Author

swaprenge commented May 12, 2022

Hi @eunjae-lee Thanks for your reply. I have setup GITHUB_TOKEN in .env file (Checking the Github token step is successful) and I am attaching the screenshot of the error I am getting.
shipjs error

Let me know if you need any other details.
Thanks.

@swaprenge
Copy link
Author

swaprenge commented May 12, 2022

github signing_shipjs

From the above image, You will get that, I have been asked to do the SignIn using the Github, but it should ask for Github enterprise SignIn, as my repository is in the Enterprise account. I am not sure how can i SignIn using the Enterprise account.

@eunjae-lee
Copy link
Contributor

Hi @swaprenge, first of all, I have no experience with GH enterprise, so I've never seen that sign-in page. So I may be wrong on what I'm talking about.

On your first screenshot I see

fatal: repository 'https://github.com/FactSet/pw-systemtools-config-dashboard/' not found

I assume.. the domain is not github.com but something of your company's, right?
Do you think if it tries to push to the correct origin, you'll see the correct sign-in page?

@eunjae-lee
Copy link
Contributor

If that's the cause, I think these three lines should change:

There can be a config for that like

// ship.config.js

module.exports = {
  githubHost: 'my-own-gh-enterprise.com'
};

What do you think? Would you be interested in contributing?

@swaprenge
Copy link
Author

If that's the cause, I think these three lines should change:

There can be a config for that like

// ship.config.js

module.exports = {
  githubHost: 'my-own-gh-enterprise.com'
};

What do you think? Would you be interested in contributing?

@eunjae-lee I think these suggested changes will be required to support the enterprise host.
And yeah, I would love to contribute. I Will raise a PR by making the changes.

Thanks.

@swaprenge
Copy link
Author

Hi @swaprenge, first of all, I have no experience with GH enterprise, so I've never seen that sign-in page. So I may be wrong on what I'm talking about.

On your first screenshot I see

fatal: repository 'https://github.com/FactSet/pw-systemtools-config-dashboard/' not found

I assume.. the domain is not github.com but something of your company's, right? Do you think if it tries to push to the correct origin, you'll see the correct sign-in page?

Yeah, If we push to the correct origin (i,e GitHub enterprise in my case) then we might see the correct sign-in page.

@eunjae-lee
Copy link
Contributor

Thanks for the contribution @swaprenge :) I'll wait for your PR then.

@swaprenge
Copy link
Author

@eunjae-lee apologies for the late, I was trying to make the above changes, but not sure about how to access githubHost defined in ship.config.js in files to replace hard-coded github.com
Can you please help me to do these changes?

Thanks.

@swaprenge
Copy link
Author

swaprenge commented Oct 4, 2022

I think I got it, We need to use the loadConfig function to get config values, Will try to use it and will update,
@eunjae-lee I am trying to push the PR, but getting permission denied.

MicrosoftTeams-image (2)

PS: I ran yarn contributors:add command as well.

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

No branches or pull requests

2 participants