Skip to content

Commit a9dce0f

Browse files
doublegateclaude
andcommitted
fix(workflow): Preserve and append to existing release notes instead of overwriting
- Modified master-pipeline.yml to check for existing release notes before updating - Appends build information only if not already present (prevents duplication) - Preserves manual release notes when workflow rebuilds artifacts - Fixes issue where detailed release notes were overwritten with generic content Technical Changes: - Extract build info into separate section for reuse - Check existing release notes before appending build information - Use gh release edit to update existing releases instead of recreating - Maintain backward compatibility with new release creation Resolved Issue: - v0.3.8 original detailed release notes have been restored - Future releases will preserve manual content while appending build info - Prevents loss of comprehensive release documentation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2a27e0d commit a9dce0f

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

.github/workflows/master-pipeline.yml

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,37 @@ jobs:
604604
run: |
605605
tag_name="${{ needs.quick-checks.outputs.release_tag }}"
606606
607+
# Create build information section
608+
cat > build_info.md << EOF
609+
610+
---
611+
612+
**Build Information:**
613+
- Pipeline Run: [${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
614+
- Commit: [${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
615+
- Build Date: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
616+
EOF
617+
607618
# Check if release already exists
608619
if gh release view "$tag_name" >/dev/null 2>&1; then
609-
echo "Release $tag_name already exists. Uploading new artifacts only..."
620+
echo "Release $tag_name already exists. Checking if we need to append build info..."
621+
622+
# Get existing release notes
623+
existing_notes=$(gh release view "$tag_name" --json body -q '.body')
624+
625+
# Check if build info already exists in notes
626+
if ! echo "$existing_notes" | grep -q "Build Information:"; then
627+
echo "Appending build information to existing release notes..."
628+
629+
# Append build info to existing notes
630+
echo "$existing_notes" > existing_notes.md
631+
cat build_info.md >> existing_notes.md
632+
633+
# Update release with appended notes
634+
gh release edit "$tag_name" --notes-file existing_notes.md
635+
else
636+
echo "Build information already exists in release notes."
637+
fi
610638
611639
# Upload artifacts to existing release (will replace if they exist)
612640
for file in release-assets/*; do
@@ -618,7 +646,7 @@ jobs:
618646
else
619647
echo "Creating new release $tag_name..."
620648
621-
# Create release notes for new release
649+
# Create minimal release notes for new release (preserves any manual notes that might be added later)
622650
cat > release_notes.md << EOF
623651
## Release $tag_name
624652
@@ -645,20 +673,16 @@ jobs:
645673
3. Run the client: \`./rustirc\` (Unix) or \`rustirc.exe\` (Windows)
646674
647675
For detailed usage instructions, see the [README](https://github.com/doublegate/RustIRC#readme).
648-
649-
---
650-
651-
**Build Information:**
652-
- Pipeline Run: [${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
653-
- Commit: [${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
654-
- Build Date: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
655676
EOF
656-
657-
# Create the new release with manual notes only
658-
gh release create "$tag_name" \
659-
--title "RustIRC $tag_name" \
660-
--notes-file release_notes.md \
661-
release-assets/*
677+
678+
# Append build info to new release notes
679+
cat build_info.md >> release_notes.md
680+
681+
# Create the new release
682+
gh release create "$tag_name" \
683+
--title "RustIRC $tag_name" \
684+
--notes-file release_notes.md \
685+
release-assets/*
662686
fi
663687
env:
664688
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)