Skip to content

Commit a179d66

Browse files
authored
Merge pull request #32 from d-oit/update-release-workflow
Update release workflow to extract only current version's changelog section
2 parents b4aebcd + a232064 commit a179d66

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/release-consolidated.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,31 @@ jobs:
6969
run: |
7070
TAG="${{ steps.tag.outputs.tag }}"
7171
72-
# Generate changelog for current tag
73-
git cliff --tag $TAG > base_notes.md
74-
72+
# Generate changelog for current tag and extract only current version section
73+
TAG_NO_V=$(echo $TAG | sed 's/^v//')
74+
git cliff --tag $TAG | awk "/^## \\[$TAG_NO_V\\]/ { found=1; print; next } /^##/ && found { exit } found { print }" > base_notes.md
75+
7576
7677
# Remove the version header line to match original format
7778
sed -i '1d' base_notes.md
79+
# Get previous tag and commit summary
80+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "")
81+
if [ -n "$PREV_TAG" ]; then
82+
COMMIT_SUMMARY=$(git log --oneline $PREV_TAG..$TAG)
83+
else
84+
COMMIT_SUMMARY="Initial release - no previous commits to summarize."
85+
fi
7886
7987
# Create enhanced release notes
8088
cat > enhanced_notes.md << EOF
8189
## Code Guardian $TAG 🛡️
8290
8391
$(cat base_notes.md)
8492
93+
### 📝 Commit Summary
94+
95+
$COMMIT_SUMMARY
96+
8597
### 📦 Installation
8698
8799
#### Download Binary

0 commit comments

Comments
 (0)