Skip to content

Commit e070a75

Browse files
committed
Add detailed commit messages to release notes
1 parent 9132d98 commit e070a75

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/create-release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ jobs:
8181
pr_list=$(git log --pretty=format:"%s" $previous_tag..$current_tag | grep "Merge pull request" | sed 's/Merge pull request #[0-9]* from [^/]*\///g' | sed 's/-/ /g' | sed 's/_/ /g' | sed 's/^/- /' || echo "")
8282
fi
8383
84+
# Get detailed commit messages with body
85+
if [ -z "$previous_tag" ]; then
86+
# If no previous tag, get recent detailed commits (limit to 20)
87+
detailed_commits=$(git log -20 --pretty=format:"### %s%n%b" | grep -v "^### Merge pull request" | grep -v "^### Merge branch" || echo "")
88+
else
89+
# Get detailed commits between previous tag and current tag
90+
detailed_commits=$(git log --pretty=format:"### %s%n%b" $previous_tag..$current_tag | grep -v "^### Merge pull request" | grep -v "^### Merge branch" || echo "")
91+
fi
92+
8493
# Ensure we have at least one item in the lists
8594
if [ -z "$commit_list" ]; then
8695
commit_list="- Updates and improvements"
@@ -94,13 +103,18 @@ jobs:
94103
echo "$pr_list" >> $GITHUB_OUTPUT
95104
echo "EOF" >> $GITHUB_OUTPUT
96105
106+
echo "DETAILED_COMMITS<<EOF" >> $GITHUB_OUTPUT
107+
echo "$detailed_commits" >> $GITHUB_OUTPUT
108+
echo "EOF" >> $GITHUB_OUTPUT
109+
97110
echo "PREVIOUS_TAG=$previous_tag" >> $GITHUB_OUTPUT
98111
shell: bash
99112

100113
- name: Create simplified release notes
101114
id: release_notes
102115
run: |
103116
version="${{ steps.get_version.outputs.VERSION }}"
117+
detailed_commits="${{ steps.get_commits.outputs.DETAILED_COMMITS }}"
104118
105119
# Use a simplified approach to avoid complex string replacements
106120
cat > release_notes.md << 'EOL'
@@ -109,6 +123,9 @@ jobs:
109123
110124
**Full Changelog**: <!-- GitHub will automatically populate this -->
111125
126+
## Detailed Changes
127+
DETAILED_COMMITS_PLACEHOLDER
128+
112129
## 🔐 Security Info
113130
114131
**Important:** Please verify your download using the information below. Any file with different values for this particular version is not from the official source.
@@ -141,6 +158,15 @@ jobs:
141158
# Replace version if needed
142159
sed -i "s/VERSION/$version/g" release_notes.md
143160
161+
# Replace detailed commits placeholder with a safer approach
162+
# First save detailed commits to a temporary file
163+
echo "$detailed_commits" > detailed_commits_temp.txt
164+
165+
# Then use a safer approach to insert the content
166+
awk -v r="$(cat detailed_commits_temp.txt)" '{gsub(/DETAILED_COMMITS_PLACEHOLDER/,r)}1' release_notes.md > temp_notes.md
167+
mv temp_notes.md release_notes.md
168+
rm detailed_commits_temp.txt
169+
144170
# Set as output
145171
echo "NOTES<<EOF" >> $GITHUB_OUTPUT
146172
cat release_notes.md >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)