fix(internal): vendor-aware GHES detection in isGhes() to support non-GitHub servers #2123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce a minimal, explicit vendor switch to prevent
isGhes()
from misclassifying non GitHub platforms (e.g., Forgejo/Gitea) as GHES, This PR adds a positive allowlist for GHES aliases and preserves current behavior for github.On self-hosted non-GitHub servers, the current heuristic (
GITHUB_SERVER_URL hostname
) often evaluates toenterprise
sending actions down GHES specific code paths and causing failures.A tiny, explicit environment switch avoids this without changing default behavior on GitHub
for reference when this breaks other platforms please see:
actions/upload-artifact#676
https://code.forgejo.org/actions/upload-artifact
https://code.forgejo.org/forgejo/runner/src/branch/main/RELEASE-NOTES.md#3-4-0
go-gitea/gitea#31256
The workaround right now is:
https://gitea.com/actions/gitea-upload-artifact/commit/81f940d004763f986ba3582c007fd842dd5cb0d7
https://code.forgejo.org/forgejo/upload-artifact/commit/16871d9e8cfcf27ff31822cac382bbb5450f1e1e