Skip to content

Allow hyphens in GitHub username mentions in release notes#390

Merged
simonhamp merged 1 commit into
mainfrom
fix-gh-username-dashes
May 19, 2026
Merged

Allow hyphens in GitHub username mentions in release notes#390
simonhamp merged 1 commit into
mainfrom
fix-gh-username-dashes

Conversation

@simonhamp
Copy link
Copy Markdown
Member

Summary

  • The regex in Release::getBodyForMarkdown() used [a-zA-Z0-9_]+ to match GitHub usernames in release notes bodies, which doesn't account for the hyphens GitHub usernames are allowed to contain (e.g. @some-user).
  • Updated the pattern to [a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])? so hyphenated handles are linked correctly, while still refusing to capture leading/trailing hyphens (which GitHub usernames cannot have).
  • Added a ReleaseTest covering plain, hyphenated, and trailing-hyphen cases.

Test plan

  • php artisan test --compact tests/Feature/Support/GitHub/ReleaseTest.php

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@simonhamp simonhamp marked this pull request as ready for review May 19, 2026 23:45
@simonhamp simonhamp merged commit 9c0c0c2 into main May 19, 2026
2 checks passed
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