|
35 | 35 | required: false |
36 | 36 | type: number |
37 | 37 | default: 15 |
38 | | - enable_tag_comparison: |
39 | | - description: 'Enable tag comparison for changelog generation' |
40 | | - required: false |
41 | | - type: boolean |
42 | | - default: true |
43 | 38 | compare_with_tag: |
44 | | - description: 'Compare with specific tag for changelog (leave empty for auto-detect previous tag)' |
| 39 | + description: 'Compare with tag for changelog (empty=auto-detect, "none"=disable comparison, or specify tag name)' |
45 | 40 | required: false |
46 | 41 | type: string |
| 42 | + default: 'auto' |
47 | 43 | custom_changelog: |
48 | 44 | description: 'Custom changelog text (prepended to auto-generated)' |
49 | 45 | required: false |
@@ -126,31 +122,30 @@ jobs: |
126 | 122 | echo "📝 Generating changelog..." |
127 | 123 | |
128 | 124 | PREV_TAG="" |
| 125 | + COMPARE_MODE="${{ inputs.compare_with_tag }}" |
129 | 126 | |
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 |
| 127 | + # Determine comparison mode |
| 128 | + if [ "$COMPARE_MODE" = "none" ] || [ "$COMPARE_MODE" = "NONE" ] || [ "$COMPARE_MODE" = "disable" ]; then |
| 129 | + echo "ℹ️ Tag comparison disabled, will show recent commits only" |
| 130 | + PREV_TAG="" |
| 131 | + elif [ "$COMPARE_MODE" = "auto" ] || [ "$COMPARE_MODE" = "AUTO" ] || [ -z "$COMPARE_MODE" ]; then |
| 132 | + # Auto-detect previous tag |
| 133 | + PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") |
| 134 | + if [ -n "$PREV_TAG" ]; then |
| 135 | + echo "🔍 Auto-detected previous tag: $PREV_TAG" |
143 | 136 | else |
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 |
| 137 | + echo "ℹ️ No previous tag found, will show recent commits" |
151 | 138 | fi |
152 | 139 | else |
153 | | - echo "ℹ️ Tag comparison disabled, will show recent commits only" |
| 140 | + # User specified a tag |
| 141 | + PREV_TAG="$COMPARE_MODE" |
| 142 | + echo "🔍 Using specified tag for comparison: $PREV_TAG" |
| 143 | + |
| 144 | + # Verify the tag exists |
| 145 | + if ! git rev-parse "$PREV_TAG" >/dev/null 2>&1; then |
| 146 | + echo "❌ Error: Tag '$PREV_TAG' does not exist" |
| 147 | + exit 1 |
| 148 | + fi |
154 | 149 | fi |
155 | 150 | |
156 | 151 | # Start changelog |
|
0 commit comments