Skip to content

Commit 0a9162d

Browse files
committed
feat: add release github action
1 parent 68d289e commit 0a9162d

File tree

1 file changed

+29
-17
lines changed

1 file changed

+29
-17
lines changed

.github/workflows/release-manager.yml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ on:
3535
required: false
3636
type: number
3737
default: 15
38+
enable_tag_comparison:
39+
description: 'Enable tag comparison for changelog generation'
40+
required: false
41+
type: boolean
42+
default: true
3843
compare_with_tag:
3944
description: 'Compare with specific tag for changelog (leave empty for auto-detect previous tag)'
4045
required: false
@@ -120,25 +125,32 @@ jobs:
120125
run: |
121126
echo "📝 Generating changelog..."
122127
123-
# Determine which tag to compare with
124-
if [ -n "${{ inputs.compare_with_tag }}" ]; then
125-
# User specified a tag
126-
PREV_TAG="${{ inputs.compare_with_tag }}"
127-
echo "🔍 Using specified tag for comparison: $PREV_TAG"
128-
129-
# Verify the tag exists
130-
if ! git rev-parse "$PREV_TAG" >/dev/null 2>&1; then
131-
echo "❌ Error: Tag '$PREV_TAG' does not exist"
132-
exit 1
133-
fi
134-
else
135-
# Auto-detect previous tag
136-
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
137-
if [ -n "$PREV_TAG" ]; then
138-
echo "🔍 Auto-detected previous tag: $PREV_TAG"
128+
PREV_TAG=""
129+
130+
# Check if tag comparison is enabled
131+
if [ "${{ inputs.enable_tag_comparison }}" = "true" ]; then
132+
# Determine which tag to compare with
133+
if [ -n "${{ inputs.compare_with_tag }}" ]; then
134+
# User specified a tag
135+
PREV_TAG="${{ inputs.compare_with_tag }}"
136+
echo "🔍 Using specified tag for comparison: $PREV_TAG"
137+
138+
# Verify the tag exists
139+
if ! git rev-parse "$PREV_TAG" >/dev/null 2>&1; then
140+
echo "❌ Error: Tag '$PREV_TAG' does not exist"
141+
exit 1
142+
fi
139143
else
140-
echo "ℹ️ No previous tag found, will show recent commits"
144+
# Auto-detect previous tag
145+
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
146+
if [ -n "$PREV_TAG" ]; then
147+
echo "🔍 Auto-detected previous tag: $PREV_TAG"
148+
else
149+
echo "ℹ️ No previous tag found, will show recent commits"
150+
fi
141151
fi
152+
else
153+
echo "ℹ️ Tag comparison disabled, will show recent commits only"
142154
fi
143155
144156
# Start changelog

0 commit comments

Comments
 (0)