File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,20 @@ class Inputs {
85
85
throw TypeError ( `target: "${ target } " is not one of "desktop" | "android" | "ios"` ) ;
86
86
}
87
87
88
- this . version = core . getInput ( "version" ) ;
88
+ // An attempt to sanitize non-straightforward version number input
89
+ let version = core . getInput ( "version" ) ;
90
+ const dots = version . match ( / \. / g) . length ;
91
+ const desiredDotCount = 2 ;
92
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
93
+ if ( dots < desiredDotCount && version . slice ( - 1 ) !== "*" ) {
94
+ version = version . concat ( ".*" ) ;
95
+ } else if ( dots > desiredDotCount ) {
96
+ throw TypeError (
97
+ `version: "${ version } $ is a malformed semantic version: must be formatted like "6.2.0" or "6.*"`
98
+ ) ;
99
+ }
100
+
101
+ this . version = version ;
89
102
90
103
this . arch = core . getInput ( "arch" ) ;
91
104
// Set arch automatically if omitted
You can’t perform that action at this time.
0 commit comments