ci(workflows): add git --stat to AI release notes

Use git log --stat since last tag (fallback to last 10) so the AI sees
file change stats, echo the log for visibility, and update the prompt to
reference "commits and changes" for more accurate, user-facing notes.
This commit is contained in:
2025-09-24 00:50:53 -07:00
parent 052eeb447c
commit dea5049be5
+8 -5
View File
@@ -87,20 +87,23 @@ jobs:
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
# Get git log since last release
# Get git log with actual changes since last release
if [ -n "${{ steps.last_tag.outputs.last_tag }}" ]; then
GIT_LOG=$(git log --pretty=format:"- %s (%an)" ${{ steps.last_tag.outputs.last_tag }}..HEAD)
GIT_LOG=$(git log --pretty=format:"**%s** (%an)" --stat ${{ steps.last_tag.outputs.last_tag }}..HEAD)
else
GIT_LOG=$(git log --pretty=format:"- %s (%an)" HEAD~10..HEAD)
GIT_LOG=$(git log --pretty=format:"**%s** (%an)" --stat HEAD~10..HEAD)
fi
echo "Git changes for release notes:"
echo "$GIT_LOG"
# Try to generate AI-powered release notes
if [ -n "$OPENAI_API_KEY" ]; then
echo "Generating AI release notes..."
PROMPT="Generate professional release notes for version ${{ steps.version.outputs.version }} based on these git commits. Focus on user-facing changes and improvements. Use markdown formatting with sections like ## What's New, ## Improvements, ## Bug Fixes. Keep it concise and under 500 words.
PROMPT="Generate professional release notes for version ${{ steps.version.outputs.version }} based on these git commits and file changes. Focus on user-facing changes and improvements. Use markdown formatting with sections like ## What's New, ## Improvements, ## Bug Fixes. Keep it concise and under 500 words.
Commits:
Commits and Changes:
$GIT_LOG"
RESPONSE=$(curl -s -X POST "https://api.openai.com/v1/responses" \