@@ -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