-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
[BUG] GITHUB_URL is magic in Github-hosted-runners, but shouldn't be used for API Calls #1374
Comments
My recommendation: Change all the places in this general pattern: - process.env["DANGER_GITHUB_API_BASE_URL"] || process.env["GITHUB_URL"] || "https://api.github.com"
+ process.env["DANGER_GITHUB_API_BASE_URL"] || "https://api.github.com"
- process.env["DANGER_GITHUB_API_BASE_URL"] || process.env["GITHUB_URL"] || undefined
+ process.env["DANGER_GITHUB_API_BASE_URL"] || "https://api.github.com" Any objections? I'm happy to submit this change. |
I've never had an enterprise account, so it was/is mostly guesswork - this does look like a breaking change though? |
@orta While this is a paid account, it's not a "Github Enterprise" account issue. It is, however, when you want to host GitHub runners on your own machines which is very enterprise-y. I think technically it's a breaking change, but it would only break some hypothetical environment that doesn't behave like Github-Public. When you're not on one of github-public's hosted runners you can't make github-api calls against |
Agree |
Describe the bug
We recently switched from Github-hosted Actions runners to Custom Runners because our CI minutes were getting too expensive, and hosting our own runners solved that problem.
But we ran into one last problem: some API calls were being sent to
https://github.com/<API_PATH>
-- but these API Paths are invalid when you use Octokit from outside of Github.Workaround: set
DANGER_GITHUB_API_BASE_URL: "https://api.github.com"
We verified that our environment variables had been the same in both locations, so my hypothesis is that when running in Github Infrastructure, you can make API calls against
github.com
instead of being required to useapi.github.com
Looking at danger-js' code, I find a handful of places where it's using `|| process.env["GITHUB_URL"]` as a fallback URL for `DANGER_GITHUB_API_BASE_URL` -- when I think it shouldn't?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
DangerJS should work equally well in Github Actions Runners (on Github Infrastructure) and on Custom Runners.
Your Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: