File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929 - name: Get Semantic Release Version
3030 id: get-version
3131 run: |
32- VERSION=$(npx semantic-release --dry-run 2>&1 | grep -o 'Release note for version [0-9]\+\.[0-9]\+\.[0-9]\+' | head -1 | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
32+ # Check if latest commit is a merge commit
33+ if git log --format="%s" -1 | grep -q "^Merge pull request"; then
34+ echo "✅ Merge commit detected, forcing patch release"
35+ # Get last tag and increment patch
36+ LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.0")
37+ VERSION=$(echo $LAST_TAG | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
38+ else
39+ VERSION=$(npx semantic-release --dry-run 2>&1 | grep -o 'Release note for version [0-9]\+\.[0-9]\+\.[0-9]\+' | head -1 | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
40+ fi
41+
3342 if [ -z "$VERSION" ]; then
3443 echo "❌ No version could be detected by semantic-release"
3544 echo "This usually means no commits warrant a release (no feat/fix/breaking changes)"
Original file line number Diff line number Diff line change 44 [
55 "@semantic-release/commit-analyzer",
66 {
7- "preset": "angular ",
7+ "preset": "conventionalcommits ",
88 "releaseRules": [
99 {"breaking": true, "release": "minor"},
1010 {"tag": "Breaking", "release": "minor"},
11- {"message ": "/^Merge pull request/ ", "release": "patch"}
11+ {"type ": "* ", "release": "patch"}
1212 ]
1313 }
1414 ],
You can’t perform that action at this time.
0 commit comments