@@ -57,6 +57,7 @@ module.exports =
57
57
// We use any as a valid input type
58
58
/* eslint-disable @typescript-eslint/no-explicit-any */
59
59
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
60
+ exports . toCommandValue = void 0 ;
60
61
/**
61
62
* Sanitizes an input into a string so it can be passed into issueCommand safely
62
63
* @param input input to sanitize into a string
@@ -88,14 +89,27 @@ module.exports = require("os");
88
89
"use strict" ;
89
90
90
91
// For internal use, subject to change.
92
+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
93
+ if ( k2 === undefined ) k2 = k ;
94
+ Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
95
+ } ) : ( function ( o , m , k , k2 ) {
96
+ if ( k2 === undefined ) k2 = k ;
97
+ o [ k2 ] = m [ k ] ;
98
+ } ) ) ;
99
+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
100
+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
101
+ } ) : function ( o , v ) {
102
+ o [ "default" ] = v ;
103
+ } ) ;
91
104
var __importStar = ( this && this . __importStar ) || function ( mod ) {
92
105
if ( mod && mod . __esModule ) return mod ;
93
106
var result = { } ;
94
- if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
95
- result [ "default" ] = mod ;
107
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
108
+ __setModuleDefault ( result , mod ) ;
96
109
return result ;
97
110
} ;
98
111
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
112
+ exports . issueCommand = void 0 ;
99
113
// We use any as a valid input type
100
114
/* eslint-disable @typescript-eslint/no-explicit-any */
101
115
const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
@@ -166,14 +180,27 @@ if (require.main === require.cache[eval('__filename')]) {
166
180
167
181
"use strict" ;
168
182
183
+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
184
+ if ( k2 === undefined ) k2 = k ;
185
+ Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
186
+ } ) : ( function ( o , m , k , k2 ) {
187
+ if ( k2 === undefined ) k2 = k ;
188
+ o [ k2 ] = m [ k ] ;
189
+ } ) ) ;
190
+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
191
+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
192
+ } ) : function ( o , v ) {
193
+ o [ "default" ] = v ;
194
+ } ) ;
169
195
var __importStar = ( this && this . __importStar ) || function ( mod ) {
170
196
if ( mod && mod . __esModule ) return mod ;
171
197
var result = { } ;
172
- if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
173
- result [ "default" ] = mod ;
198
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
199
+ __setModuleDefault ( result , mod ) ;
174
200
return result ;
175
201
} ;
176
202
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
203
+ exports . issue = exports . issueCommand = void 0 ;
177
204
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
178
205
const utils_1 = __webpack_require__ ( 82 ) ;
179
206
/**
@@ -252,6 +279,25 @@ function escapeProperty(s) {
252
279
253
280
"use strict" ;
254
281
282
+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
283
+ if ( k2 === undefined ) k2 = k ;
284
+ Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
285
+ } ) : ( function ( o , m , k , k2 ) {
286
+ if ( k2 === undefined ) k2 = k ;
287
+ o [ k2 ] = m [ k ] ;
288
+ } ) ) ;
289
+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
290
+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
291
+ } ) : function ( o , v ) {
292
+ o [ "default" ] = v ;
293
+ } ) ;
294
+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
295
+ if ( mod && mod . __esModule ) return mod ;
296
+ var result = { } ;
297
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
298
+ __setModuleDefault ( result , mod ) ;
299
+ return result ;
300
+ } ;
255
301
var __awaiter = ( this && this . __awaiter ) || function ( thisArg , _arguments , P , generator ) {
256
302
function adopt ( value ) { return value instanceof P ? value : new P ( function ( resolve ) { resolve ( value ) ; } ) ; }
257
303
return new ( P || ( P = Promise ) ) ( function ( resolve , reject ) {
@@ -261,14 +307,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
261
307
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
262
308
} ) ;
263
309
} ;
264
- var __importStar = ( this && this . __importStar ) || function ( mod ) {
265
- if ( mod && mod . __esModule ) return mod ;
266
- var result = { } ;
267
- if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
268
- result [ "default" ] = mod ;
269
- return result ;
270
- } ;
271
310
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
311
+ exports . getState = exports . saveState = exports . group = exports . endGroup = exports . startGroup = exports . info = exports . warning = exports . error = exports . debug = exports . isDebug = exports . setFailed = exports . setCommandEcho = exports . setOutput = exports . getBooleanInput = exports . getMultilineInput = exports . getInput = exports . addPath = exports . setSecret = exports . exportVariable = exports . ExitCode = void 0 ;
272
312
const command_1 = __webpack_require__ ( 431 ) ;
273
313
const file_command_1 = __webpack_require__ ( 102 ) ;
274
314
const utils_1 = __webpack_require__ ( 82 ) ;
@@ -335,7 +375,9 @@ function addPath(inputPath) {
335
375
}
336
376
exports . addPath = addPath ;
337
377
/**
338
- * Gets the value of an input. The value is also trimmed.
378
+ * Gets the value of an input.
379
+ * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
380
+ * Returns an empty string if the value is not defined.
339
381
*
340
382
* @param name name of the input to get
341
383
* @param options optional. See InputOptions.
@@ -346,9 +388,49 @@ function getInput(name, options) {
346
388
if ( options && options . required && ! val ) {
347
389
throw new Error ( `Input required and not supplied: ${ name } ` ) ;
348
390
}
391
+ if ( options && options . trimWhitespace === false ) {
392
+ return val ;
393
+ }
349
394
return val . trim ( ) ;
350
395
}
351
396
exports . getInput = getInput ;
397
+ /**
398
+ * Gets the values of an multiline input. Each value is also trimmed.
399
+ *
400
+ * @param name name of the input to get
401
+ * @param options optional. See InputOptions.
402
+ * @returns string[]
403
+ *
404
+ */
405
+ function getMultilineInput ( name , options ) {
406
+ const inputs = getInput ( name , options )
407
+ . split ( '\n' )
408
+ . filter ( x => x !== '' ) ;
409
+ return inputs ;
410
+ }
411
+ exports . getMultilineInput = getMultilineInput ;
412
+ /**
413
+ * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
414
+ * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
415
+ * The return value is also in boolean type.
416
+ * ref: https://yaml.org/spec/1.2/spec.html#id2804923
417
+ *
418
+ * @param name name of the input to get
419
+ * @param options optional. See InputOptions.
420
+ * @returns boolean
421
+ */
422
+ function getBooleanInput ( name , options ) {
423
+ const trueValue = [ 'true' , 'True' , 'TRUE' ] ;
424
+ const falseValue = [ 'false' , 'False' , 'FALSE' ] ;
425
+ const val = getInput ( name , options ) ;
426
+ if ( trueValue . includes ( val ) )
427
+ return true ;
428
+ if ( falseValue . includes ( val ) )
429
+ return false ;
430
+ throw new TypeError ( `Input does not meet YAML 1.2 "Core Schema" specification: ${ name } \n` +
431
+ `Support boolean input list: \`true | True | TRUE | false | False | FALSE\`` ) ;
432
+ }
433
+ exports . getBooleanInput = getBooleanInput ;
352
434
/**
353
435
* Sets the value of an output.
354
436
*
0 commit comments