Skip to content

Commit cd3846a

Browse files
committed
Enhance release notes & release creation
Improve the GitHub Actions release notes generation and release creation steps. The AI prompt now requests additional sections (Documentation, Dependency Updates, Test Improvements, Build/Workflow Enhancements) and excludes embedding a full changelog; a Full Changelog link is generated and appended to the notes and temp release file. Fixes formatting/newlines when writing the temp notes file. Also normalize release checks and titles to use the raw inputs.revision value (remove enforced "v" prefix) to avoid duplicate prefixes when creating releases.
1 parent eeed171 commit cd3846a

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/maven-publish.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ jobs:
119119
prompt = (
120120
f"Generate concise release notes for version {current_tag}.\n\n"
121121
f"Commits since {prev_tag}:\n{commits}\n\n"
122-
"Format the output as markdown with sections for New Features, Bug Fixes, "
123-
"and Other Changes (only include sections that have relevant commits). "
122+
"Format the output as markdown with sections if present for New Features, Bug Fixes, "
123+
"Documentations, Dependency Updates, Test Improvements, Build and Workflow Enhancements "
124+
"and Other Changes(excludes Full Changelog).\n\n"
124125
"Be concise and clear."
125126
)
126127
@@ -153,20 +154,25 @@ jobs:
153154
if [ ! -f "$NOTES_FILE" ]; then
154155
printf "# Release Notes\n\n" > "$NOTES_FILE"
155156
fi
157+
158+
FULL_CHANGELOG="**Full Changelog**: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/compare/$PREV_TAG...$CURRENT_TAG"
159+
156160
printf "## v%s\n\n%s\n\n" "$CURRENT_TAG" "$SUMMARY" >> "$NOTES_FILE"
157-
161+
printf "%s" "$FULL_CHANGELOG" >> "$NOTES_FILE"
162+
158163
# Write the current release notes to a temp file for the Create Release step
159-
printf "%s" "$SUMMARY" > /tmp/current-release-notes.md
164+
printf "%s\n\n" "$SUMMARY" > /tmp/current-release-notes.md
165+
printf "%s" "$FULL_CHANGELOG" >> /tmp/current-release-notes.md
160166
161167
echo "Release notes generated and appended to $NOTES_FILE"
162168
163169
- name: Create Release
164170
run: |
165-
if gh release view "v${{ inputs.revision }}" >/dev/null 2>&1; then
166-
echo "Release v${{ inputs.revision }} already exists, skipping."
171+
if gh release view "${{ inputs.revision }}" >/dev/null 2>&1; then
172+
echo "Release ${{ inputs.revision }} already exists, skipping."
167173
else
168174
gh release create ${{ inputs.revision }} \
169-
--title "v${{ inputs.revision }}" \
175+
--title "${{ inputs.revision }}" \
170176
--notes-file /tmp/current-release-notes.md \
171177
--latest
172178
fi

0 commit comments

Comments
 (0)