Skip to content

Conversation

@emilsvennesson
Copy link

Fix Co-authored-by trailer for GitHub Enterprise Server (GHES)

Changes

  • Fixed the Co-authored-by trailer in commit instructions to use the correct noreply email domain for GitHub Enterprise Server (GHES) instances
  • Previously hardcoded to users.noreply.github.com, now correctly derives the domain from GITHUB_SERVER_URL
  • Extracted the noreply email domain logic into a shared utility function getNoreplyEmailDomain() to reduce duplication between git-config.ts and create-prompt/index.ts

Test Plan

  • Added comprehensive unit tests for getNoreplyEmailDomain() covering:
    • Standard github.com URLs
    • GHES instances with various hostnames
    • URLs with ports, paths, and trailing slashes
  • All existing tests pass
  • TypeScript type checking passes

🤖 Generated with Claude Code

emilsvennesson and others added 2 commits January 14, 2026 10:43
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 <[email protected]>
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant