Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ jobs:
- name: Get Semantic Release Version
id: get-version
run: |
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]\+')
# Check if latest commit is a merge commit
if git log --format="%s" -1 | grep -q "^Merge pull request"; then
echo "✅ Merge commit detected, forcing patch release"
# Get last tag and increment patch
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.0")
VERSION=$(echo $LAST_TAG | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
else
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]\+')
fi

if [ -z "$VERSION" ]; then
echo "❌ No version could be detected by semantic-release"
echo "This usually means no commits warrant a release (no feat/fix/breaking changes)"
Expand Down
4 changes: 2 additions & 2 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"preset": "conventionalcommits",
"releaseRules": [
{"breaking": true, "release": "minor"},
{"tag": "Breaking", "release": "minor"},
{"message": "/^Merge pull request/", "release": "patch"}
{"type": "*", "release": "patch"}
]
}
],
Expand Down
Loading