@@ -5,22 +5,22 @@ This file demonstrates how the automated version detection works with different
5
5
## Branch-Based Version Detection
6
6
7
7
### ✅ 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
9
9
10
10
``` bash
11
- # Developer workflow:
11
+ # Feature branch workflow:
12
12
git checkout master
13
13
git 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"
16
16
git push origin feat/new-user-authentication
17
17
18
18
# Create PR and merge to master
19
19
# Result: Automatic minor version bump v0.10.2 → v0.11.0
20
20
```
21
21
22
22
### ✅ 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
24
24
25
25
``` bash
26
26
# Bug fix:
@@ -31,40 +31,90 @@ git commit -m "fix: resolve session timeout issue"
31
31
# Documentation:
32
32
git checkout -b docs/update-api-guide
33
33
git commit -m " docs: update API documentation"
34
- # Result: v0.10.2 → v0.10.3
34
+ # Result: skipped - docs don't trigger releases
35
35
36
36
# Refactoring:
37
37
git checkout -b refactor/cleanup-auth
38
38
git commit -m " refactor: simplify authentication flow"
39
39
# Result: v0.10.2 → v0.10.3
40
40
```
41
41
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
43
63
44
64
The system checks in this order:
45
65
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)
49
75
- Results in minor version bump (Y)
50
76
51
- 2 . ** Everything else** (default)
77
+ 3 . ** Everything else** (default)
52
78
- All other branch merges and commits
53
79
- Results in patch version bump (Z)
54
80
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
56
108
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
64
113
65
114
This ensures that:
115
+ - ✅ Major version (X) requires manual intervention for safety
66
116
- ✅ New features always increment minor version (Y number)
67
117
- ✅ 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