@@ -8,6 +8,7 @@ class Action {
8
8
this . PROJECT_FILE_PATH = process . env . INPUT_PROJECT_FILE_PATH
9
9
this . VERSION_FILE_PATH = process . env . INPUT_VERSION_FILE_PATH || process . env . VERSION_FILE_PATH
10
10
this . VERSION_REGEX = new RegExp ( process . env . INPUT_VERSION_REGEX || process . env . VERSION_REGEX )
11
+ this . VERSION_STATIC = process . env . INPUT_VERSION_STATIC || process . env . VERSION_STATIC
11
12
this . TAG_COMMIT = JSON . parse ( process . env . INPUT_TAG_COMMIT || process . env . TAG_COMMIT )
12
13
this . TAG_FORMAT = process . env . INPUT_TAG_FORMAT || process . env . TAG_FORMAT
13
14
this . NUGET_KEY = process . env . INPUT_NUGET_KEY || process . env . NUGET_KEY
@@ -85,17 +86,22 @@ class Action {
85
86
run ( ) {
86
87
if ( ! this . PROJECT_FILE_PATH )
87
88
this . _fail ( "😭 project file not given" )
88
-
89
89
this . PROJECT_FILE_PATH = this . _resolveIfExists ( this . PROJECT_FILE_PATH , "😭 project file not found" )
90
- this . VERSION_FILE_PATH = ! this . VERSION_FILE_PATH ? this . PROJECT_FILE_PATH : this . _resolveIfExists ( this . VERSION_FILE_PATH , "😭 version file not found" )
90
+
91
+ let CURRENT_VERSION = ""
92
+
93
+ if ( ! this . VERSION_STATIC ) {
94
+ this . VERSION_FILE_PATH = ! this . VERSION_FILE_PATH ? this . PROJECT_FILE_PATH : this . _resolveIfExists ( this . VERSION_FILE_PATH , "😭 version file not found" )
91
95
92
- const FILE_CONTENT = fs . readFileSync ( this . VERSION_FILE_PATH , { encoding : "utf-8" } ) ,
93
- VERSION_INFO = this . VERSION_REGEX . exec ( FILE_CONTENT )
96
+ const FILE_CONTENT = fs . readFileSync ( this . VERSION_FILE_PATH , { encoding : "utf-8" } ) ,
97
+ VERSION_INFO = this . VERSION_REGEX . exec ( FILE_CONTENT )
94
98
95
- if ( ! VERSION_INFO )
96
- this . _fail ( "😢 unable to extract version info" )
99
+ if ( ! VERSION_INFO )
100
+ this . _fail ( "😢 unable to extract version info! " )
97
101
98
- const CURRENT_VERSION = VERSION_INFO [ 1 ]
102
+ CURRENT_VERSION = VERSION_INFO [ 1 ]
103
+ } else
104
+ CURRENT_VERSION = this . VERSION_STATIC
99
105
100
106
if ( ! this . PACKAGE_NAME )
101
107
this . PACKAGE_NAME = path . basename ( this . PROJECT_FILE_PATH ) . split ( "." ) . slice ( 0 , - 1 ) . join ( "." )
0 commit comments