Skip to content

Commit

Permalink
fix: Strip type/scope from changelog lines (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Jun 23, 2024
1 parent 4aea156 commit 705fdd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/publish/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const publish = async (options) => {
return {
hash: c.hash.substring(0, 7),
body: c.body,
message: c.message,
subject: parsed.subject ?? '',
author_name: c.author_name,
author_email: c.author_email,
type: parsed.type?.toLowerCase() ?? 'other',
Expand Down Expand Up @@ -145,7 +145,7 @@ export const publish = async (options) => {
if (commit.body.includes('BREAKING CHANGE')) {
releaseLevel = Math.max(releaseLevel, 2)
}
if (commit.message.includes('RELEASE_ALL') || commit.body.includes('RELEASE_ALL')) {
if (commit.subject.includes('RELEASE_ALL') || commit.body.includes('RELEASE_ALL')) {
RELEASE_ALL = true
}
}
Expand Down Expand Up @@ -296,9 +296,9 @@ export const publish = async (options) => {
}

const scope = commit.scope ? `${commit.scope}: ` : ''
const message = commit.message
const subject = commit.subject

return `- ${scope}${message} (${commit.hash}) ${
return `- ${scope}${subject} (${commit.hash}) ${
username
? `by @${username}`
: `by ${commit.author_name || commit.author_email}`
Expand Down
2 changes: 1 addition & 1 deletion src/publish/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type Commit = {
hash: string
body: string
message: string
subject: string
author_name: string
author_email: string
type: string
Expand Down

0 comments on commit 705fdd4

Please sign in to comment.