Skip to content

Commit 9429872

Browse files
committed
Clean up spacing in changelog CI
1 parent e60aafe commit 9429872

File tree

1 file changed

+4
-67
lines changed

1 file changed

+4
-67
lines changed

.github/workflows/prepare-release.yml

Lines changed: 4 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -120,78 +120,15 @@ jobs:
120120
ALL_PR_COMMITS=$(git rev-list --reverse origin/${{ env.REPO_B_TARGET }}..HEAD)
121121
122122
# Create changelog entry
123-
changelog_entry="## ${{ steps.version.outputs.new_version }} ($(date +%Y-%m-%d))
123+
changelog_entry="## ${{ steps.version.outputs.new_version }} ($(date +%Y-%m-%d))\n
124+
Full Changelog: [${{ steps.version.outputs.current_version }}...${{ steps.version.outputs.new_version }}](https://github.com/${{ github.repository }}/compare/${{ steps.version.outputs.current_version }}...${{ steps.version.outputs.new_version }})\n\n"
124125
125-
Full Changelog: [${{ steps.version.outputs.current_version }}...${{ steps.version.outputs.new_version }}](https://github.com/${{ github.repository }}/compare/${{ steps.version.outputs.current_version }}...${{ steps.version.outputs.new_version }})
126-
"
127-
128-
# Add features section
129-
has_feat_commits=false
130-
for commit in $ALL_PR_COMMITS; do
131-
if [ -n "$commit" ]; then
132-
commit_msg=$(git log --format="%s" -1 "$commit")
133-
if echo "$commit_msg" | grep -q "feat:"; then
134-
if [ "$has_feat_commits" = false ]; then
135-
changelog_entry="${changelog_entry}
136-
### Features
137-
"
138-
has_feat_commits=true
139-
fi
140-
# Remove "feat: " prefix and add to changelog with commit link
141-
feature_desc=$(echo "$commit_msg" | sed 's/feat: //')
142-
short_sha=$(echo "$commit" | cut -c1-7)
143-
changelog_entry="${changelog_entry}* ${feature_desc} ([${short_sha}](https://github.com/${{ github.repository }}/commit/${commit}))
144-
"
145-
fi
146-
fi
147-
done
148-
149-
if [ "$has_feat_commits" = true ]; then
150-
changelog_entry="${changelog_entry}
151-
"
152-
fi
153-
154-
# Add fixes section
155-
has_fixes=false
156-
for commit in $ALL_PR_COMMITS; do
157-
if [ -n "$commit" ]; then
158-
commit_msg=$(git log --format="%s" -1 "$commit")
159-
if echo "$commit_msg" | grep -q "fix:"; then
160-
if [ "$has_fixes" = false ]; then
161-
changelog_entry="${changelog_entry}
162-
### Bug Fixes
163-
"
164-
has_fixes=true
165-
fi
166-
# Remove "fix: " prefix and add to changelog with commit link
167-
fix_desc=$(echo "$commit_msg" | sed 's/fix: //')
168-
short_sha=$(echo "$commit" | cut -c1-7)
169-
changelog_entry="${changelog_entry}* ${fix_desc} ([${short_sha}](https://github.com/${{ github.repository }}/commit/${commit}))
170-
"
171-
fi
172-
fi
173-
done
174-
175-
if [ "$has_fixes" = true ]; then
176-
changelog_entry="${changelog_entry}
177-
"
178-
fi
179-
180-
# Add other changes section
181-
has_other=false
182126
for commit in $ALL_PR_COMMITS; do
183127
if [ -n "$commit" ]; then
184128
commit_msg=$(git log --format="%s" -1 "$commit")
185-
if ! echo "$commit_msg" | grep -q -E "^(feat:|fix:|Update sync state)"; then
186-
if [ "$has_other" = false ]; then
187-
changelog_entry="${changelog_entry}
188-
### Other Changes
189-
"
190-
has_other=true
191-
fi
129+
if ! echo "$commit_msg" | grep -q -E "^(Update sync state)"; then
192130
short_sha=$(echo "$commit" | cut -c1-7)
193-
changelog_entry="${changelog_entry}* ${commit_msg} ([${short_sha}](https://github.com/${{ github.repository }}/commit/${commit}))
194-
"
131+
changelog_entry="${changelog_entry}- ${commit_msg} ([${short_sha}](https://github.com/${{ github.repository }}/commit/${commit}))\n"
195132
fi
196133
fi
197134
done

0 commit comments

Comments
 (0)