do not show merge commits when updating github release.

This commit is contained in:
arabcoders 2025-07-04 19:50:12 +03:00
parent a5812a7d61
commit 3219517555

View file

@ -210,15 +210,17 @@ jobs:
return; return;
} }
const { data: commits } = await github.rest.repos.compareCommits({ const { data: comparison } = await github.rest.repos.compareCommits({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
base: latestRelease.data[1]?.tag_name || '', // fallback to second latest tag base: latestRelease.data[1]?.tag_name || '', // fallback to second latest tag
head: tag, head: tag,
}); });
const commits = comparison.commits.filter(c => 1 === c.parents.length);
const changelog = commits.commits.map( 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'); ).join('\n');
if (!changelog) { if (!changelog) {