Skip to content

Commit c243d8d

Browse files
committed
Enhance release notes generation and release command
Expand the AI prompt to include additional release sections (Documentation, Dependency Updates, Test Improvements, Build and Workflow Enhancements) and clarify formatting. Add a Full Changelog link (compare URL) and append it to both the repository NOTES_FILE and the temp release notes file. Tweak output formatting (newlines) and adjust gh release checks/creation to use the raw input revision (remove forced `v` prefix from view/title) and improve quoting/outputs.
1 parent cf266e3 commit c243d8d

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
@@ -120,8 +120,9 @@ jobs:
120120
prompt = (
121121
f"Generate concise release notes for version {current_tag}.\n\n"
122122
f"Commits since {prev_tag}:\n{commits}\n\n"
123-
"Format the output as markdown with sections for New Features, Bug Fixes, "
124-
"and Other Changes (only include sections that have relevant commits). "
123+
"Format the output as markdown with sections if present for New Features, Bug Fixes, "
124+
"Documentations, Dependency Updates, Test Improvements, Build and Workflow Enhancements "
125+
"and Other Changes(excludes Full Changelog).\n\n"
125126
"Be concise and clear."
126127
)
127128
@@ -154,20 +155,25 @@ jobs:
154155
if [ ! -f "$NOTES_FILE" ]; then
155156
printf "# Release Notes\n\n" > "$NOTES_FILE"
156157
fi
158+
159+
FULL_CHANGELOG="**Full Changelog**: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/compare/$PREV_TAG...$CURRENT_TAG"
160+
157161
printf "## v%s\n\n%s\n\n" "$CURRENT_TAG" "$SUMMARY" >> "$NOTES_FILE"
158-
162+
printf "%s" "$FULL_CHANGELOG" >> "$NOTES_FILE"
163+
159164
# Write the current release notes to a temp file for the Create Release step
160-
printf "%s" "$SUMMARY" > /tmp/current-release-notes.md
165+
printf "%s\n\n" "$SUMMARY" > /tmp/current-release-notes.md
166+
printf "%s" "$FULL_CHANGELOG" >> /tmp/current-release-notes.md
161167
162168
echo "Release notes generated and appended to $NOTES_FILE"
163169
164170
- name: Create Release
165171
run: |
166-
if gh release view "v${{ inputs.revision }}" >/dev/null 2>&1; then
167-
echo "Release v${{ inputs.revision }} already exists, skipping."
172+
if gh release view "${{ inputs.revision }}" >/dev/null 2>&1; then
173+
echo "Release ${{ inputs.revision }} already exists, skipping."
168174
else
169175
gh release create ${{ inputs.revision }} \
170-
--title "v${{ inputs.revision }}" \
176+
--title "${{ inputs.revision }}" \
171177
--notes-file /tmp/current-release-notes.md \
172178
--latest
173179
fi

0 commit comments

Comments
 (0)