do not show merge commits when updating github release.
This commit is contained in:
parent
a5812a7d61
commit
3219517555
1 changed files with 4 additions and 2 deletions
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue