Support Claude-written changelogs in tag annotations

Workflow now checks for annotated tags and uses the annotation
as release notes. If no annotation exists, falls back to GitHub's
auto-generation.

This allows Claude to write formatted release notes when creating
releases, stored directly in git history as part of the tag.
This commit is contained in:
rcourtman 2025-11-13 11:56:02 +00:00
parent d77ea9e6f8
commit e782468f4a

View file

@ -312,9 +312,21 @@ jobs:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
run: | run: |
TAG="${{ needs.extract-version.outputs.tag }}" TAG="${{ needs.extract-version.outputs.tag }}"
VERSION="${{ needs.extract-version.outputs.version }}"
echo "Generating release notes for ${TAG}..." echo "Generating release notes for ${TAG}..."
# Check if tag has an annotation (release notes from Claude)
TAG_MESSAGE=$(git tag -l --format='%(contents)' "${TAG}")
NOTES_FILE=$(mktemp)
if [ -n "$TAG_MESSAGE" ] && [ "$TAG_MESSAGE" != "" ]; then
echo "Using release notes from tag annotation"
echo "$TAG_MESSAGE" > "$NOTES_FILE"
else
echo "No tag annotation found, generating release notes from commits..."
# Get previous tag # Get previous tag
PREV_TAG=$(git tag --sort=-version:refname | grep -A1 "^${TAG}$" | tail -1) PREV_TAG=$(git tag --sort=-version:refname | grep -A1 "^${TAG}$" | tail -1)
@ -336,13 +348,10 @@ jobs:
# Extract the generated body # Extract the generated body
GENERATED_NOTES=$(echo "$NOTES_JSON" | jq -r '.body') GENERATED_NOTES=$(echo "$NOTES_JSON" | jq -r '.body')
# Save to file for the release
NOTES_FILE=$(mktemp)
echo "$GENERATED_NOTES" > "$NOTES_FILE" echo "$GENERATED_NOTES" > "$NOTES_FILE"
fi
# Add installation instructions # Add installation instructions
VERSION="${{ needs.extract-version.outputs.version }}"
cat >> "$NOTES_FILE" << EOF cat >> "$NOTES_FILE" << EOF
## Installation ## Installation