-
Notifications
You must be signed in to change notification settings - Fork 363
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
fix: Use correct baseUrl when running in non-public Github instances #1371
fix: Use correct baseUrl when running in non-public Github instances #1371
Conversation
|
Thanks for describing your issue and suggesting a resolution! When you refer to "non-public GitHub instances", do you mean a self-hosted runner in a GitHub Enterprise Server or perhaps GitHub Enterprise Cloud? I assume that you don't mean just a private repository using a GitHub-hosted runner. The code you propose to change was added by the Cypress Cloud team, so I would expect that they should be involved in any changes here. |
Yes, exactly what I mean, thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't detect an issue with this, assuming the GITHUB_API_URL
is always present, which is seems like it would be. Thanks for the contribution.
🎉 This PR is included in version 6.7.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Would you like to check that this now works correctly in your environment? Your fix has now been published. I don't have access to a GitHub Enterprise environment in order to test. |
Yes, I'll do that now. |
@MikeMcC399 👋 Was able to test and I'm now able to remove the I've realised that there is a similar problem with In this case CI won't crash - the Cypress UI will just point to an incorrect |
Many thanks for testing!
Would you open a separate issue for this? Or if you are able and willing to fix it, then go straight to a PR. Thanks again! |
Will do, thanks @MikeMcC399! Edit |
Issue?
When running the action against a non-public GH instance, the api request to determine build-id from Github would fail.
I believe this is due to the incorrect (public) GH instance being contacted.
How?
The fix uses:
baseUrl
constuctor option of Octokit: https://github.com/octokit/octokit.js/blob/main/README.md#constructor-optionsGITHUB_API_URL
environment variable: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables