refactor!: don't include the commit sha when pull request reference is included

Signed-off-by: Ardalan Amini <[email protected]>
This commit is contained in:
Ardalan Amini committed 2023-04-30 01:18:31 +03:30
1 parent 45380686a1
commit d9c18ae1be
3 files changed
+8 -5

No files matched your search

+6 -3
View File
@@ -71,6 +71,9 @@ export async function generateChangelog(lastSha?: string): Promise<string> {
const { owner, repo, url } = repository();
const defaultType = defaultCommitType();
const typeMap = commitTypes();
const shouldIncludePRLinks = includePRLinks();
const shouldIncludeCommitLinks = includeCommitLinks();
const shouldMentionAuthors = mentionAuthors();
const iterator = paginate.iterator(
rest.repos.listCommits,
@@ -142,11 +145,11 @@ export async function generateChangelog(lastSha?: string): Promise<string> {
const reference: string[] = [];
if (pr && includePRLinks()) reference.push(`${ url }/issues/${ pr }`);
if (pr && shouldIncludePRLinks) reference.push(`${ url }/issues/${ pr }`);
if (includeCommitLinks()) reference.push(`${ url }/commit/${ commit.sha }`);
if ((!pr || !shouldIncludePRLinks) && shouldIncludeCommitLinks) reference.push(`${ url }/commit/${ commit.sha }`);
if (commit.author?.login && mentionAuthors()) reference.push(`by @${ commit.author.login }`);
if (commit.author?.login && shouldMentionAuthors) reference.push(`by @${ commit.author.login }`);
if (reference.length > 0) log.references.push(reference.join(" "));
}