File tree 4 files changed +15
-6
lines changed 4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ successful completion of all steps and detection of a new version (`post`).
236
236
237
237
| input | type | default | description |
238
238
|--------------|------------------|---------|-------------------------------------------------------------------------|
239
- | init-version | string | 0.0 .0 | initial version of the project |
239
+ | init-version | string | 0.1 .0 | initial version of the project |
240
240
| tag-prefix | string | v | tag prefix, useful for versioning multiple components in one repository |
241
241
| assets | multiline string | | list of files to be upload as assets |
242
242
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ branding:
6
6
color : purple
7
7
inputs :
8
8
init-version :
9
- description : ' The init version of project default: 0.0 .0'
9
+ description : ' The init version of project default: 0.1 .0'
10
10
required : false
11
- default : ' 0.0 .0'
11
+ default : ' 0.1 .0'
12
12
tag-prefix :
13
13
description : ' The prefix of version tag, default: v'
14
14
required : false
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const FEATURE_REGEX = new RegExp(/^feat(|\(.+\)): /);
10
10
const github = GithubService . create ( ) ;
11
11
12
12
async function main ( ) {
13
- const initVersion = core . getInput ( 'init-version' ) || '0.0 .0' ;
13
+ const initVersion = core . getInput ( 'init-version' ) || '0.1 .0' ;
14
14
const tagPrefix = core . getInput ( 'tag-prefix' ) || 'v' ;
15
15
16
16
core . debug ( `main: input initVersion: ${ initVersion } ` ) ;
@@ -121,6 +121,10 @@ function createChangelog(messages: string[]): string[] {
121
121
}
122
122
123
123
function increaseVersionByMessages ( version : Version , messages : string [ ] ) : Version {
124
+ if ( version . isIncreased ( ) ) {
125
+ return version ;
126
+ }
127
+
124
128
if ( messages . findIndex ( breakingChangeTest ) >= 0 ) {
125
129
return version . increaseMajor ( ) ;
126
130
}
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ export class Version {
9
9
this . increased = increased ;
10
10
}
11
11
12
- public static parse ( version ?: string , initVersion : string = '0.0 .0' , prefix : string = 'v' ) {
12
+ public static parse ( version ?: string , initVersion : string = '0.1 .0' , prefix : string = 'v' ) {
13
13
if ( version === undefined ) {
14
- return new Version ( new SemVer ( initVersion ) ) ;
14
+ return new Version ( new SemVer ( initVersion ) , true ) ;
15
15
}
16
16
17
17
const versionWithoutPrefix = version . replace ( prefix , '' ) ;
@@ -57,6 +57,11 @@ export class Version {
57
57
}
58
58
59
59
private increase ( type : 'major' | 'minor' | 'patch' ) : Version {
60
+ // prevent double version increase
61
+ if ( this . increased ) {
62
+ return this ;
63
+ }
64
+
60
65
const version = new SemVer ( this . version . raw ) ;
61
66
version . inc ( type ) ;
62
67
You can’t perform that action at this time.
0 commit comments