Skip to content

Commit

Permalink
(mathieudutour#145) use defaultBump for initial prerelease version, d…
Browse files Browse the repository at this point in the history
…efaultPreReleaseBump only when updating a prerelease version

**BREAKING CHANGE:** this change changes the behaviour of drafting prereleases
  • Loading branch information
martin-hartmond-mw committed Apr 21, 2023
1 parent 663cac3 commit 08da861
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,14 @@ export default async function main() {

// If we don't have an automatic bump for the prerelease, just set our bump as the default
if (isPrerelease && !bump) {
bump = defaultPreReleaseBump;
if (previousVersion.prerelease.length == 0)
// previous version is a prerelease -> draft a new version with the default bump and make it a prerelease
bump = defaultBump;
else
bump = defaultPreReleaseBump;
}

// TODO: these next 10 lines are horrible!! why we have preminor as bump type at all if it is always striped away?
// If somebody uses custom release rules on a prerelease branch they might create a 'preprepatch' bump.
const preReg = /^pre/;
if (isPrerelease && preReg.test(bump)) {
Expand Down

0 comments on commit 08da861

Please sign in to comment.