Skip to content

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

Merged
jennifer-shehane merged 2 commits into
cypress-io:masterfrom
mungodewar:allow-enterprise-users-automatic-build-configuration
Mar 7, 2025
Merged

fix: Use correct baseUrl when running in non-public Github instances#1371
jennifer-shehane merged 2 commits into
cypress-io:masterfrom
mungodewar:allow-enterprise-users-automatic-build-configuration

Conversation

@mungodewar

@mungodewar mungodewar commented Feb 25, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator

@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

CLAassistant commented Feb 25, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@MikeMcC399

Copy link
Copy Markdown
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
Copy Markdown
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

@jennifer-shehane jennifer-shehane left a comment

Copy link
Copy Markdown
Member

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
@github-actions

github-actions Bot commented Mar 7, 2025

Copy link
Copy Markdown

🎉 This PR is included in version 6.7.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MikeMcC399

Copy link
Copy Markdown
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

mungodewar commented Mar 10, 2025

Copy link
Copy Markdown
Contributor Author

@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

mungodewar commented Mar 10, 2025

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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

mungodewar commented Mar 10, 2025

Copy link
Copy Markdown
Contributor Author

@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