@@ -14769,7 +14769,7 @@ const github = github_1.GithubService.create();
14769
14769
function main() {
14770
14770
var _a, _b;
14771
14771
return __awaiter(this, void 0, void 0, function* () {
14772
- const initVersion = core.getInput('init-version') || '0.0 .0';
14772
+ const initVersion = core.getInput('init-version') || '0.1 .0';
14773
14773
const tagPrefix = core.getInput('tag-prefix') || 'v';
14774
14774
core.debug(`main: input initVersion: ${initVersion}`);
14775
14775
core.debug(`main: input tagPrefix: ${tagPrefix}`);
@@ -14850,6 +14850,9 @@ function createChangelog(messages) {
14850
14850
return messages.map(message => message.split('\n')[0]);
14851
14851
}
14852
14852
function increaseVersionByMessages(version, messages) {
14853
+ if (version.isIncreased()) {
14854
+ return version;
14855
+ }
14853
14856
if (messages.findIndex(breakingChangeTest) >= 0) {
14854
14857
return version.increaseMajor();
14855
14858
}
@@ -14889,9 +14892,9 @@ class Version {
14889
14892
this.version = version;
14890
14893
this.increased = increased;
14891
14894
}
14892
- static parse(version, initVersion = '0.0 .0', prefix = 'v') {
14895
+ static parse(version, initVersion = '0.1 .0', prefix = 'v') {
14893
14896
if (version === undefined) {
14894
- return new Version(new semver_1.SemVer(initVersion));
14897
+ return new Version(new semver_1.SemVer(initVersion), true );
14895
14898
}
14896
14899
const versionWithoutPrefix = version.replace(prefix, '');
14897
14900
return new Version(new semver_1.SemVer(versionWithoutPrefix));
@@ -14925,6 +14928,10 @@ class Version {
14925
14928
return `${prefix}${version}`;
14926
14929
}
14927
14930
increase(type) {
14931
+ // prevent double version increase
14932
+ if (this.increased) {
14933
+ return this;
14934
+ }
14928
14935
const version = new semver_1.SemVer(this.version.raw);
14929
14936
version.inc(type);
14930
14937
return new Version(version, true);
0 commit comments