Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure outputUnreleased resolved correctly given lernaPackage/tagPrefix #865

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/conventional-changelog-core/lib/merge-config.js
Expand Up @@ -195,9 +195,19 @@ function mergeConfig (options, context, gitRawCommitsOpts, parserOpts, writerOpt
if (tagsObj.state === 'fulfilled') {
gitSemverTags = context.gitSemverTags = tagsObj.value
fromTag = gitSemverTags[options.releaseCount - 1]

const lastTag = gitSemverTags[0]
let compareTagTo

if (options.lernaPackage) {
compareTagTo = options.lernaPackage + '@' + context.version
} else if (options.tagPrefix) {
compareTagTo = options.tagPrefix + context.version
} else {
compareTagTo = 'v' + context.version
}

if (lastTag === context.version || lastTag === 'v' + context.version) {
if (lastTag === context.version || lastTag === compareTagTo) {
if (options.outputUnreleased) {
context.version = 'Unreleased'
} else {
Expand Down