|
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 |
38 | 43 | compare_with_tag: |
39 | 44 | description: 'Compare with specific tag for changelog (leave empty for auto-detect previous tag)' |
40 | 45 | required: false |
@@ -120,25 +125,32 @@ jobs: |
120 | 125 | run: | |
121 | 126 | echo "📝 Generating changelog..." |
122 | 127 | |
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 |
139 | 143 | 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 |
141 | 151 | fi |
| 152 | + else |
| 153 | + echo "ℹ️ Tag comparison disabled, will show recent commits only" |
142 | 154 | fi |
143 | 155 | |
144 | 156 | # Start changelog |
|
0 commit comments