From 3219517555391967ec5fdde684459345f54e7744 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Fri, 4 Jul 2025 19:50:12 +0300 Subject: [PATCH] do not show merge commits when updating github release. --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c4fd07cb..1ba0c5be 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -210,15 +210,17 @@ jobs: return; } - const { data: commits } = await github.rest.repos.compareCommits({ + const { data: comparison } = await github.rest.repos.compareCommits({ owner: context.repo.owner, repo: context.repo.repo, base: latestRelease.data[1]?.tag_name || '', // fallback to second latest tag head: tag, }); + const commits = comparison.commits.filter(c => 1 === c.parents.length); + const changelog = commits.commits.map( - c => `- ${c.sha.substring(0, 7)} ${c.commit.message.split('\n')[0]} by ${c.commit.author.name}` + c => `- ${c.sha.substring(0, 7)} ${c.commit.message.split('\n')[0]} by @${c.commit.author.name}` ).join('\n'); if (!changelog) {