Skip to content

Commit

Permalink
fix: bump version not working
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed May 25, 2022
1 parent 80c978b commit 6488b24
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/bumper.js
Expand Up @@ -45,11 +45,12 @@ module.exports = async (
} else if (type === 'assembly') {
currentVersion = getCurrentVersionAssembly(projectFile);
}
logInfo(`Current version: ${currentVersion}`);

const commitMessages = await getCommitMessages(gitEvents, token);
logInfo(`Found commit messages: ${JSON.stringify(commitMessages, null, 4)}`);

const relevantCommitMessages = getRelevantCommitMessages(commitMessages, releaseCommitMessageRegex ? releaseCommitMessageRegex : commitMessageToUse, tagPrefix);
const relevantCommitMessages = getRelevantCommitMessages(commitMessages, releaseCommitMessageRegex, tagPrefix);
logInfo(`Relevant commit messages: ${JSON.stringify(relevantCommitMessages, null, 4)}`);
if (relevantCommitMessages.length === 0) {
exitSuccess('No action necessary because latest commit was a bump!');
Expand All @@ -58,19 +59,6 @@ module.exports = async (

const {doMajorVersion, doMinorVersion, doPatchVersion, doPreReleaseVersion} = analyseVersionChange(majorWording, minorWording, patchWording, rcWording, commitMessages);

// case: if default=prerelease,
// rc-wording is also set
// and does not include any of rc-wording
// then unset it and do not run
if (
doPreReleaseVersion &&
rcWording &&
!commitMessages.some((message) => rcWording.some((word) => message.includes(word)))
) {
logInfo('Default bump version sat to a nonexisting prerelease wording, skipping bump.');
return false;
}

//Should we do any version updates?
if (!doMajorVersion && !doMinorVersion && !doPatchVersion && !doPreReleaseVersion) {
logInfo('Could not find any version bump to make, skipping.');
Expand All @@ -92,8 +80,7 @@ module.exports = async (
// We want to override the branch that we are pulling / pushing to
currentBranch = targetBranch;
}
logInfo('Current branch:', currentBranch);
logInfo('Current version:', currentVersion);
logInfo(`Current branch: ${currentBranch}`);

//Bump version
const newVersion = bumpVersion(currentVersion, doMajorVersion, doMinorVersion, doPatchVersion, doPreReleaseVersion, preReleaseId);
Expand Down

0 comments on commit 6488b24

Please sign in to comment.