Skip to content

fix: Use release branches instead of direct push to main#39

Merged
ydeng11 merged 1 commit intomainfrom
fix/versioning-workflow-branch-protection
Dec 16, 2025
Merged

fix: Use release branches instead of direct push to main#39
ydeng11 merged 1 commit intomainfrom
fix/versioning-workflow-branch-protection

Conversation

@ydeng11
Copy link
Owner

@ydeng11 ydeng11 commented Dec 16, 2025

Problem

The versioning workflow was attempting to push directly to the protected main branch, which is not allowed due to branch protection rules requiring changes through pull requests.

Solution

  • Updated .github/workflows/versioning.yml to create release branches instead of pushing directly to main
  • Both release and next-snapshot jobs now:
    • Create a release branch (e.g., release/1.0.0 or release/next-snapshot-1.0.1-SNAPSHOT)
    • Push the branch to remote
    • Display a notice prompting to open a pull request
  • Updated local scripts (version-release.sh and version-next-snapshot.sh) to follow the same pattern

Changes

  • ✅ Release job creates release/{version} branch
  • ✅ Next-snapshot job creates release/next-snapshot-{version} branch
  • ✅ Tags are still pushed directly (as they don't require branch protection)
  • ✅ Both scripts updated with branch-based workflow instructions

This respects branch protection rules and enables releases through pull requests for the main branch.

- Update versioning workflow to create release branches instead of pushing directly to protected main branch
- Both release and next-snapshot jobs now create branches and prompt for PR creation
- Update local scripts to follow the same pattern
- Respects branch protection rules requiring PRs for main branch
@ydeng11 ydeng11 merged commit d283f9c into main Dec 16, 2025
3 checks passed
@ydeng11 ydeng11 deleted the fix/versioning-workflow-branch-protection branch December 16, 2025 20:06
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