feat(github): add GitHub Enterprise Server support to GitHub Action#13860
Open
balcsida wants to merge 24 commits intoanomalyco:devfrom
Open
feat(github): add GitHub Enterprise Server support to GitHub Action#13860balcsida wants to merge 24 commits intoanomalyco:devfrom
balcsida wants to merge 24 commits intoanomalyco:devfrom
Conversation
|
Great request to allow use in Enterprise |
3e83e03 to
ed86139
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Fixes #12830
The GitHub Action hardcodes
github.comURLs everywhere, so it can't run on GHES. This PR readsGITHUB_SERVER_URLandGITHUB_API_URLenv vars (set automatically by GHES runners) and uses them to derive all host-specific values — Octokit/GraphQLbaseUrl, git credential config keys, noreply emails, fork remote URLs, image attachment regexes, and the token revocation endpoint. Defaults togithub.comwhen the env vars aren't set, so nothing changes for existing users.Also adds a
parseGitRemotefunction (host-agnostic version ofparseGitHubRemote) so theinstallcommand detects GHES remotes and generates a workflow withuse_github_token: trueand write permissions pre-configured.How did you verify your code works?
bun build --no-bundlebun test test/cli/github-remote.test.tsandgithub-action.test.ts)parseGitRemotewith GHES URLs, SSH, HTTPS, various hostsgithub.comreferences that should be parameterized (only defaults, comments, and the opencode app URL which correctly stays on github.com)