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

fix: Use correct baseUrl when running in non-public Github instances #1371

Conversation

mungodewar
Copy link
Contributor

@mungodewar mungodewar commented Feb 25, 2025

Issue?

When running the action against a non-public GH instance, the api request to determine build-id from Github would fail.

Bad Credentials

I believe this is due to the incorrect (public) GH instance being contacted.

How?

The fix uses:

@cypress-app-bot
Copy link

@mungodewar mungodewar marked this pull request as ready for review February 25, 2025 16:19
@MikeMcC399 MikeMcC399 added the bug Something isn't working label Feb 25, 2025
@CLAassistant
Copy link

CLAassistant commented Feb 25, 2025

CLA assistant check
All committers have signed the CLA.

@MikeMcC399
Copy link
Collaborator

@mungodewar

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.

@mungodewar
Copy link
Contributor Author

do you mean a self-hosted runner in a GitHub Enterprise Server

Yes, exactly what I mean, thank you.

@jennifer-shehane jennifer-shehane self-requested a review March 4, 2025 17:13
Copy link
Member

@jennifer-shehane jennifer-shehane left a 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.

@jennifer-shehane jennifer-shehane merged commit a2da478 into cypress-io:master Mar 7, 2025
74 checks passed
Copy link

github-actions bot commented Mar 7, 2025

🎉 This PR is included in version 6.7.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MikeMcC399
Copy link
Collaborator

@mungodewar

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.

@mungodewar
Copy link
Contributor Author

mungodewar commented Mar 10, 2025

@mungodewar

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.

@mungodewar
Copy link
Contributor Author

mungodewar commented Mar 10, 2025

@MikeMcC399 👋 Was able to test and I'm now able to remove the CYPRESS_PULL_REQUEST_URL env var as expected 🎉

I've realised that there is a similar problem with getCIBuildId too.

In this case CI won't crash - the Cypress UI will just point to an incorrect github.com GHA run.

@MikeMcC399
Copy link
Collaborator

@mungodewar

Was able to test and I'm now able to remove the CYPRESS_PULL_REQUEST_URL env var as expected 🎉

Many thanks for testing!

I've realised that there is a similar problem with getCIBuildId too.

In this case CI won't crash - the Cypress UI will just point to an incorrect github.com GHA run.

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!

@mungodewar
Copy link
Contributor Author

mungodewar commented Mar 10, 2025

@mungodewar

Was able to test and I'm now able to remove the CYPRESS_PULL_REQUEST_URL env var as expected 🎉

Many thanks for testing!

I've realised that there is a similar problem with getCIBuildId too.
In this case CI won't crash - the Cypress UI will just point to an incorrect github.com GHA run.

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
Ref: #1395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Cypress Cloud released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants