fix: use correct noreply email domain for GHES in Co-authored-by#820
Open
emilsvennesson wants to merge 2 commits intoanthropics:mainfrom
Open
fix: use correct noreply email domain for GHES in Co-authored-by#820emilsvennesson wants to merge 2 commits intoanthropics:mainfrom
emilsvennesson wants to merge 2 commits intoanthropics:mainfrom
Conversation
The Co-authored-by trailer in commit instructions was hardcoded to use `users.noreply.github.com`, which is incorrect for GitHub Enterprise Server instances. This fix derives the noreply domain from GITHUB_SERVER_URL, matching the behavior already used in git-config.ts for configuring the git user email. For github.com: `users.noreply.github.com` For GHES: `users.noreply.<ghes-hostname>` Co-Authored-By: Claude <noreply@anthropic.com>
Extract the GHES-aware noreply email domain logic into a reusable utility function `getNoreplyEmailDomain()` in src/utils/noreply-email.ts. This reduces code duplication between git-config.ts and create-prompt/index.ts, and makes the logic easy to test independently. Added comprehensive tests covering: - github.com (standard case) - GHES instances with various hostnames - URLs with ports, paths, and trailing slashes Co-Authored-By: Claude <noreply@anthropic.com>
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.
Fix Co-authored-by trailer for GitHub Enterprise Server (GHES)
Changes
users.noreply.github.com, now correctly derives the domain fromGITHUB_SERVER_URLgetNoreplyEmailDomain()to reduce duplication betweengit-config.tsandcreate-prompt/index.tsTest Plan
getNoreplyEmailDomain()covering:🤖 Generated with Claude Code