docs: fix release action to include all commit info

This commit is contained in:
Jake Turner 2026-02-11 22:38:55 -08:00 committed by Jake Turner
parent a49322b63b
commit fcb696587a
2 changed files with 37 additions and 1 deletions

View File

@ -4,6 +4,7 @@
#
# Stamps the "## Unreleased" section in a release-notes file with a version
# and date, and extracts the section content for use in GitHub releases / email.
# Also includes all commits since the last release for complete transparency.
#
# Usage: finalize-release-notes.sh <version> <file-path>
#
@ -86,11 +87,44 @@ NEW_HEADER="## Version ${VERSION} - ${DATE_STAMP}"
mv "${FILE}.tmp" "$FILE"
# Get commits since the last release
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
COMMIT_LIST=""
if [[ -n "$LAST_TAG" ]]; then
echo "Fetching commits since ${LAST_TAG}..."
# Get commits between last tag and HEAD, excluding merge commits and skip ci commits
COMMIT_LIST=$(git log "${LAST_TAG}..HEAD" \
--no-merges \
--pretty=format:"- %s ([%h](https://github.com/${GITHUB_REPOSITORY}/commit/%H))" \
--grep="\[skip ci\]" --invert-grep \
|| echo "")
else
echo "No previous tag found, fetching all commits..."
COMMIT_LIST=$(git log \
--no-merges \
--pretty=format:"- %s ([%h](https://github.com/${GITHUB_REPOSITORY}/commit/%H))" \
--grep="\[skip ci\]" --invert-grep \
|| echo "")
fi
# Write the extracted section content (for GitHub release body / future email)
{
echo "$NEW_HEADER"
echo ""
echo "$TRIMMED"
if [[ -n "$TRIMMED" ]]; then
echo "$TRIMMED"
echo ""
fi
# Add commit history if available
if [[ -n "$COMMIT_LIST" ]]; then
echo "---"
echo ""
echo "### 📝 All Changes"
echo ""
echo "$COMMIT_LIST"
fi
} > "${FILE}.section"
echo "Finalized release notes for v${VERSION}"

View File

@ -39,6 +39,8 @@ jobs:
- name: Finalize release notes
if: steps.semver.outputs.new_release_published == 'true'
id: finalize-notes
env:
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
git pull origin master
chmod +x .github/scripts/finalize-release-notes.sh