From 25f16f767b2a71d91fccc7196f5897f913c744e1 Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Sat, 13 Sep 2025 13:06:46 +0200 Subject: [PATCH] feat: create clean commit messages without merge PR text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🎨 **Cleaner Commit Messages:** Instead of keeping the merge PR text, the workflow now creates clean, semantic commit messages: **Before:** **After:** **Commit Title Format:** - 🚀 Major Release (for breaking changes) - ✨ Minor Release (for new features) - 🐛 Patch Release (for bug fixes) This creates a much cleaner git history focused on the actual changes rather than GitHub merge mechanics. --- .github/workflows/version-and-publish.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/version-and-publish.yml b/.github/workflows/version-and-publish.yml index 2cfeb8a..a3e0e5f 100644 --- a/.github/workflows/version-and-publish.yml +++ b/.github/workflows/version-and-publish.yml @@ -133,18 +133,23 @@ jobs: - name: Update merge commit with changelog if: steps.version-type.outputs.type != 'none' run: | - # Get the merge commit (HEAD) - MERGE_COMMIT=$(git rev-parse HEAD) + # Extract version type for commit title + VERSION_TYPE="${{ steps.version-type.outputs.type }}" - # Get original commit message - ORIGINAL_MSG=$(git log -1 --format=%B) + # Create clean commit message with just the changelog + if [ "$VERSION_TYPE" = "major" ]; then + COMMIT_TITLE="🚀 Major Release" + elif [ "$VERSION_TYPE" = "minor" ]; then + COMMIT_TITLE="✨ Minor Release" + else + COMMIT_TITLE="🐛 Patch Release" + fi - # Create new commit message with changelog - NEW_MSG="$ORIGINAL_MSG + NEW_MSG="$COMMIT_TITLE ${{ steps.changelog.outputs.changelog }}" - # Amend the merge commit with the new message + # Amend the merge commit with the clean message git commit --amend -m "$NEW_MSG" - name: Version bump