Skip to content

fix: sanitize branch names for semantic-release prerelease#1230

Merged
abueide merged 1 commit intomasterfrom
fix/sanitize-branch-names-for-prerelease
Apr 15, 2026
Merged

fix: sanitize branch names for semantic-release prerelease#1230
abueide merged 1 commit intomasterfrom
fix/sanitize-branch-names-for-prerelease

Conversation

@abueide
Copy link
Copy Markdown
Contributor

@abueide abueide commented Apr 15, 2026

Summary

Fixes the semantic-release configuration to prevent branch names with underscores from breaking releases.

Problem

The wildcard branch config ({ name: '*', prerelease: true }) uses the raw branch name as the prerelease identifier. Branch names with underscores (e.g., leanplum_plugin_integration) violate the SemVer specification which only allows [0-9A-Za-z-] in prerelease identifiers.

This caused the beta channel release to fail with:

EPRERELEASEBRANCH A pre-release branch configuration is invalid in the `branches` configuration.

Solution

Changed the wildcard branch config to use a fixed prerelease identifier ('beta') instead of the branch name:

{ name: '*', prerelease: 'beta' }

This ensures:

  • All feature/fix branches publish as beta prereleases (e.g., 1.2.3-beta.1)
  • SemVer compliance regardless of branch naming
  • Releases work even with branches containing underscores

Test Plan

  • Verified configuration syntax
  • Test beta release from a branch with underscores
  • Test beta release from the fix/ios-zero-second-sessions branch

🤖 Generated with Claude Code

The wildcard branch config was using `prerelease: true` which uses
the raw branch name as the prerelease identifier. Branch names with
underscores (e.g., leanplum_plugin_integration) are invalid per
SemVer spec and cause releases to fail.

Changed to `prerelease: 'beta'` so all non-master/non-support-branch
releases use 'beta' as the prerelease identifier, ensuring SemVer
compliance.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@abueide abueide merged commit f549af6 into master Apr 15, 2026
12 checks passed
@abueide abueide deleted the fix/sanitize-branch-names-for-prerelease branch April 15, 2026 20:07
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