### 🚀 Features
- Added `validate` job that runs on version branch PRs as required status check
- Added pre-merge validation with tests, build, and branch type detection
### 🐛 Bug Fixes
- Fixed workflow timing: now blocks PR merge until validation passes
- Changed trigger from `types: [closed]` to `types: [opened, synchronize, reopened]`
- Separated validation (PR) from publishing (post-merge) workflows
### 🔧 Improvements
- Version publishing only runs after successful merge to main
- Clear messaging about release type during PR validation
- Prevents immediate PR closure before workflow completion
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
### 🐛 Bug Fixes
- Fixed YAML parsing error on line 146 caused by improper heredoc delimiter indentation
- Removed redundant blank lines for consistent formatting throughout workflow
### 🔧 Improvements
- Ensured CLAUDE_EOF delimiter is properly indented to match YAML context
- Cleaned up workflow formatting for better readability
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Deleted VERSION_WORKFLOW.md as the content is no longer relevant with the updated branch and versioning structure
- Streamlined repository by removing obsolete documentation to prevent confusion
- Removed version folder branch validation (no longer relevant with new branch structure)
- Simplified Claude CLI integration by removing fallback installation logic
- Streamlined workflow for more concise and focused validation steps
🗂️ **New Branch Structure:**
Changed from version/ prefixes to folder-based branches:
**Old Structure:**
- version/major
- version/minor
- version/patch
**New Structure:**
- major/ (folder branch)
- minor/ (folder branch)
- patch/ (folder branch)
**Usage Examples:**
- major/breaking-api-changes
- minor/new-email-features
- patch/fix-validation-bug
**Benefits:**
✅ More intuitive folder structure
✅ Better organization of related changes
✅ Clearer semantic meaning
✅ Multiple features can be worked on in parallel under same type
**Updated Logic:**
- Uses startsWith() instead of contains() for branch detection
- Updated validation to check for folder branches
- Enhanced error messages with examples
🧹 Code Cleanup:
- Removed unused create_fallback_changelog function
- Function was left over from when we had fallback changelog generation
- Now using fail-fast approach - Claude must succeed or workflow fails
⏱️ Increased Claude Timeout:
- Claude changelog generation timeout: 60s → 240s (4x increase)
- Allows more time for complex changelog analysis
- Reduces chance of timeout failures for large changesets
- Still fails fast if Claude is unavailable or errors occur
Result: Cleaner code with more reliable Claude integration!
🛡️ **Critical Security & Reliability Fixes:**
### 🚫 Fixed Force Push Safety Risk
- Added remote HEAD comparison before force pushing
- Aborts workflow if remote main updated by another process
- Prevents concurrent workflow conflicts and data loss
- Enhanced error messages for push failures
### 🤖 Enhanced Claude CLI Reliability
- Removed fallback changelog generation (fails fast instead)
- Added 60s timeout for Claude CLI calls
- Validates Claude CLI availability before proceeding
- Clear error messages when changelog generation fails
- Required dependency: changelog generation must succeed
### 📦 Fixed Version Management Issues
- Replaced npm version with custom Node.js script
- Eliminates package manager inconsistencies
- Proper pnpm lockfile synchronization after version changes
- No more package-lock.json conflicts in pnpm projects
### ⚛️ Atomic Commit Creation
- Single atomic commit instead of multiple amend operations
- Eliminates race conditions from multiple git operations
- All changes (code + version + lockfile) in one commit
- Safer git reset strategy with proper base commit detection
### 🔍 Enhanced Error Handling & Debugging
- Comprehensive error checking at each step
- Debug output for troubleshooting failures
- Graceful cleanup of temporary files
- Clear error messages for common failure scenarios
**Result:** Production-ready workflow that safely handles concurrent operations and fails fast on errors! 🎯
🔄 **Ultra-Clean Git History:**
Now creates one beautiful commit per release instead of multiple merge commits:
**Before:**
```
abc123 Merge pull request #45 from version/minor
def456 feat: add email scheduling
ghi789 fix: validation bug
jkl012 docs: update readme
mno345 test: add unit tests
```
**After:**
```
abc123 ✨ Minor Release
## Changes
### 🚀 Features
- Add email scheduling feature
### 🐛 Bug Fixes
- Fix validation error handling
### 📚 Documentation
- Update readme with new examples
```
**How it works:**
1. Analyzes commits since last release tag
2. Squashes all PR commits into single commit
3. Uses semantic emoji titles (🚀🔧🐛)
4. Includes AI-generated changelog with categorized changes
5. Adds version bump changes to same commit
**Result:** Perfect git history with one meaningful commit per release! 🎉
🎨 **Cleaner Commit Messages:**
Instead of keeping the merge PR text, the workflow now creates clean, semantic commit messages:
**Before:**
**After:**
**Commit Title Format:**
- 🚀 Major Release (for breaking changes)
- ✨ Minor Release (for new features)
- 🐛 Patch Release (for bug fixes)
This creates a much cleaner git history focused on the actual changes rather than GitHub merge mechanics.
🔧 **Improved Changelog Integration:**
- Changelog is now appended to the PR merge commit message instead of creating a separate commit
- Version bump changes are included in the same amended merge commit
- Uses git commit --amend to modify the merge commit with both changelog and version changes
- Updated force push with --force-with-lease for safer history rewriting
- Cleaner git history with single commit containing all release information
**Benefits:**
- ✅ Single commit per release (cleaner history)
- ✅ Changelog directly visible in merge commit
- ✅ No additional 'chore: bump version' commits
- ✅ All release info consolidated in one place
- ✅ Safer force push with --force-with-lease
🐛 **Fixes Applied:**
### Package Manager Alignment
- Switched from npm to pnpm throughout workflow to match project setup
- Added proper pnpm cache configuration for faster builds
- Used pnpm/action-setup@v4 for pnpm installation
- Kept npm for version bumping only (pnpm lacks version command)
### Deprecated Action Replacement
- Replaced deprecated actions/create-release@v1 with gh CLI
- Updated to use gh release create for better reliability
- Improved release notes formatting with proper escaping
### Missing Output Declaration
- Added proper outputs declaration to version-and-publish job
- Exposed new-version, current-version, and version-type outputs
- Fixed notify-success job to properly reference outputs
- Added conditional check to prevent empty version notifications
### Additional Improvements
- Enhanced lockfile handling for both package-lock.json and pnpm-lock.yaml
- Added --no-git-checks flag to pnpm publish for CI environment
- Improved success notification with version change details
- Created version/major, version/minor, and version/patch branches for semantic versioning
- Added GitHub Actions workflow for automated version bumping and publishing
- Integrated Claude Code CLI for AI-generated changelogs in commit messages and releases
- Added comprehensive documentation for version workflow usage
- Workflow includes testing, building, NPM publishing, and GitHub releases
- Changelog categorizes changes into Features, Bug Fixes, Improvements, Documentation, and Performance