algolia / shipjs

Take control of what is going to be your next release.
https://community.algolia.com/shipjs/
MIT License
765 stars 30 forks source link

Not able to authenticate using Github Enterprise version #981

Open swaprenge opened 2 years ago

swaprenge commented 2 years ago

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):

Additional context NA

eunjae-lee commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

swaprenge commented 2 years ago

@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 commented 2 years ago

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.