Skip to content

Commit 82c6bb2

Browse files
authored
Feature/update release notes (#21)
* new format for release notes * update changelog with commit messages * use all commit messages in release notes * remove release.yml
1 parent 5030123 commit 82c6bb2

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,33 @@ jobs:
5555
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo $(git rev-list --max-parents=0 HEAD))
5656
CURR_TAG="v${{ steps.version_check.outputs.rawVersion }}"
5757
58-
# Generate simple release notes with commit messages
59-
NOTES=$(git log --pretty=format:"* %s" $PREV_TAG..HEAD --no-merges)
58+
# Initialize release notes file
6059
echo "## What's Changed" > release_notes.md
6160
echo "" >> release_notes.md
62-
echo "$NOTES" >> release_notes.md
61+
62+
# Get all commits between previous tag and HEAD
63+
for COMMIT_HASH in $(git log --no-merges --pretty=format:"%H" $PREV_TAG..HEAD); do
64+
# Get commit message
65+
COMMIT_MSG=$(git log --format=%B -n 1 $COMMIT_HASH)
66+
67+
# Extract PR number if present
68+
PR_NUM=$(echo "$COMMIT_MSG" | grep -o "#[0-9]\+" | head -1 | tr -d "#")
69+
70+
if [ -n "$PR_NUM" ]; then
71+
# PR number found, get commits from this PR
72+
echo "* $COMMIT_MSG" >> release_notes.md
73+
74+
PR_COMMITS=$(gh pr view $PR_NUM --json commits --jq '.commits[].messageHeadline')
75+
76+
if [ -n "$PR_COMMITS" ]; then
77+
# Add indented PR commits to notes
78+
echo "$PR_COMMITS" | grep -v "Merge" | sed 's/^/ - /' >> release_notes.md
79+
fi
80+
else
81+
# Regular commit, not from a squashed PR
82+
echo "* $COMMIT_MSG" >> release_notes.md
83+
fi
84+
done
6385
6486
# Create the release with notes
6587
gh release create "$CURR_TAG" --notes-file release_notes.md

0 commit comments

Comments
 (0)