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. |
jennifer-shehane
left a comment
There was a problem hiding this comment.
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:
baseUrlconstuctor option of Octokit: https://github.com/octokit/octokit.js/blob/main/README.md#constructor-optionsGITHUB_API_URLenvironment variable: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables