@@ -5,22 +5,22 @@ This file demonstrates how the automated version detection works with different
55## Branch-Based Version Detection
66
77### ✅ Minor Version Bump (v0.10.2 → v0.11.0)
8- ** Trigger** : Merging from ` feat* ` branches
8+ ** Trigger** : Merging from ` feat* ` branches or commits with ` feat: ` prefix
99
1010``` bash
11- # Developer workflow:
11+ # Feature branch workflow:
1212git checkout master
1313git checkout -b feat/new-user-authentication
14- git commit -m " add OAuth login support"
15- git commit -m " add user profile management"
14+ git commit -m " feat: add OAuth login support"
15+ git commit -m " feat: add user profile management"
1616git push origin feat/new-user-authentication
1717
1818# Create PR and merge to master
1919# Result: Automatic minor version bump v0.10.2 → v0.11.0
2020```
2121
2222### ✅ Patch Version Bump (v0.10.2 → v0.10.3)
23- ** Trigger** : Merging from any other branch
23+ ** Trigger** : Merging from any other branch or non-feature commits
2424
2525``` bash
2626# Bug fix:
@@ -31,40 +31,90 @@ git commit -m "fix: resolve session timeout issue"
3131# Documentation:
3232git checkout -b docs/update-api-guide
3333git commit -m " docs: update API documentation"
34- # Result: v0.10.2 → v0.10.3
34+ # Result: skipped - docs don't trigger releases
3535
3636# Refactoring:
3737git checkout -b refactor/cleanup-auth
3838git commit -m " refactor: simplify authentication flow"
3939# Result: v0.10.2 → v0.10.3
4040```
4141
42- ## Detection Priority
42+ ## 🚫 Skipped Releases
43+
44+ The system automatically skips releases for:
45+
46+ - ** Dependency updates** : Branches starting with ` dep* ` or ` dependabot* `
47+ - ** Documentation** : Branches starting with ` docs* ` or commits with ` docs: `
48+ - ** Release commits** : Prevents infinite loops from release automation
49+ - ** Version bumps** : Updates to dependencies or version files
50+
51+ ``` bash
52+ # These will NOT trigger releases:
53+ git checkout -b deps/update-actions
54+ git commit -m " deps: update GitHub Actions to latest"
55+
56+ git checkout -b docs/fix-readme
57+ git commit -m " docs: fix typos in README"
58+
59+ # Direct commits to master with these patterns also skip releases
60+ ```
61+
62+ ## Detection Priority & Logic
4363
4464The system checks in this order:
4565
46- 1 . ** Feature branches** (highest priority)
47- - Checks merged branch names for ` feat* ` pattern
48- - Also checks commit messages for ` feat: ` prefix
66+ 1 . ** Skip conditions** (highest priority)
67+ - Dependency/docs/release branch patterns
68+ - Dependency/docs/release commit message patterns
69+ - Existing release commit patterns (prevents loops)
70+
71+ 2 . ** Feature detection** (second priority)
72+ - Merged branch names matching ` feat* ` pattern
73+ - Commit messages with ` feat: ` , ` feat(): ` , or ` feature: ` prefix
74+ - Breaking change indicators (treated as minor for safety)
4975 - Results in minor version bump (Y)
5076
51- 2 . ** Everything else** (default)
77+ 3 . ** Everything else** (default)
5278 - All other branch merges and commits
5379 - Results in patch version bump (Z)
5480
55- ## Example Scenarios
81+ ## Enhanced Example Scenarios
82+
83+ | Branch Name | Commit Message | Result | Reason |
84+ | -----------------| ------------------------------| -------------------| ---------------------------------|
85+ | ` feat/auth ` | "feat: add login system" | v0.10.2 → v0.11.0 | Feature branch + feat commit |
86+ | ` fix/bug ` | "fix: resolve crash" | v0.10.2 → v0.10.3 | Non-feature branch |
87+ | ` docs/readme ` | "docs: update guide" | ** Skipped** | Documentation update |
88+ | ` deps/actions ` | "deps: update actions" | ** Skipped** | Dependency update |
89+ | ` fix/bug ` | "feat: add new feature" | v0.10.2 → v0.11.0 | feat in commit message |
90+ | ` refactor/code ` | "BREAKING CHANGE: new API" | v0.10.2 → v0.11.0 | Breaking change (conservative) |
91+ | ` any-branch ` | "🤖 Fully Automated Release" | ** Skipped** | Release commit (prevents loops) |
92+
93+ ## Advanced Features
94+
95+ ### 🔄 ** Infinite Loop Prevention**
96+ - Detects its own release commits and skips them
97+ - Prevents cascading releases from automation
98+
99+ ### 🎯 ** Smart Branch Analysis**
100+ - Analyzes both branch names and commit messages
101+ - Handles various conventional commit formats
102+ - Conservative approach to breaking changes
103+
104+ ### ✅ ** Validation & Safety**
105+ - Validates version format before processing
106+ - Checks for existing tags to prevent duplicates
107+ - Provides detailed logging for debugging
56108
57- | Branch Name | Commit Message | Version Change | Reason |
58- | -------------| ----------------| ----------------| ---------|
59- | ` feat/auth ` | "add login system" | v0.10.2 → v0.11.0 | feat branch (minor) |
60- | ` fix/bug ` | "fix: resolve crash" | v0.10.2 → v0.10.3 | non-feat branch (patch) |
61- | ` docs/readme ` | "docs: update guide" | v0.10.2 → v0.10.3 | non-feat branch (patch) |
62- | ` fix/bug ` | "feat: add new feature" | v0.10.2 → v0.11.0 | feat in commit (minor) |
63- | ` refactor/code ` | "refactor: improve structure" | v0.10.2 → v0.10.3 | non-feat branch (patch) |
109+ ### 🔧 ** Manual Override**
110+ - Supports manual workflow dispatch
111+ - Allows override of auto-detection logic
112+ - Useful for emergency releases or major versions
64113
65114This ensures that:
115+ - ✅ Major version (X) requires manual intervention for safety
66116- ✅ New features always increment minor version (Y number)
67117- ✅ Bug fixes and other changes increment patch version (Z number)
68- - ✅ Major version (X) is only incremented manually
69- - ✅ Documentation and dependency updates don't trigger releases
70- - ✅ No manual version management needed
118+ - ✅ Documentation and dependency updates don't clutter releases
119+ - ✅ No manual version management needed for regular development
120+ - ✅ Robust protection against automation loops
0 commit comments