From dea5049be5e06ba92e870da0d6baa4c3eb54012c Mon Sep 17 00:00:00 2001 From: Zack3D Date: Wed, 24 Sep 2025 00:50:53 -0700 Subject: [PATCH] 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. --- .gitea/workflows/multi-platform.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/multi-platform.yml b/.gitea/workflows/multi-platform.yml index 799dd8e..b50c63d 100644 --- a/.gitea/workflows/multi-platform.yml +++ b/.gitea/workflows/multi-platform.yml @@ -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" \