@@ -191,6 +191,32 @@ function onceStrict (fn) {
191
191
}
192
192
193
193
194
+ /***/ } ) ,
195
+
196
+ /***/ 82 :
197
+ /***/ ( function ( __unusedmodule , exports ) {
198
+
199
+ "use strict" ;
200
+
201
+ // We use any as a valid input type
202
+ /* eslint-disable @typescript-eslint/no-explicit-any */
203
+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
204
+ /**
205
+ * Sanitizes an input into a string so it can be passed into issueCommand safely
206
+ * @param input input to sanitize into a string
207
+ */
208
+ function toCommandValue ( input ) {
209
+ if ( input === null || input === undefined ) {
210
+ return '' ;
211
+ }
212
+ else if ( typeof input === 'string' || input instanceof String ) {
213
+ return input ;
214
+ }
215
+ return JSON . stringify ( input ) ;
216
+ }
217
+ exports . toCommandValue = toCommandValue ;
218
+ //# sourceMappingURL=utils.js.map
219
+
194
220
/***/ } ) ,
195
221
196
222
/***/ 87 :
@@ -200,6 +226,42 @@ module.exports = require("os");
200
226
201
227
/***/ } ) ,
202
228
229
+ /***/ 102 :
230
+ /***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
231
+
232
+ "use strict" ;
233
+
234
+ // For internal use, subject to change.
235
+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
236
+ if ( mod && mod . __esModule ) return mod ;
237
+ var result = { } ;
238
+ if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
239
+ result [ "default" ] = mod ;
240
+ return result ;
241
+ } ;
242
+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
243
+ // We use any as a valid input type
244
+ /* eslint-disable @typescript-eslint/no-explicit-any */
245
+ const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
246
+ const os = __importStar ( __webpack_require__ ( 87 ) ) ;
247
+ const utils_1 = __webpack_require__ ( 82 ) ;
248
+ function issueCommand ( command , message ) {
249
+ const filePath = process . env [ `GITHUB_${ command } ` ] ;
250
+ if ( ! filePath ) {
251
+ throw new Error ( `Unable to find environment variable for file command ${ command } ` ) ;
252
+ }
253
+ if ( ! fs . existsSync ( filePath ) ) {
254
+ throw new Error ( `Missing file at path: ${ filePath } ` ) ;
255
+ }
256
+ fs . appendFileSync ( filePath , `${ utils_1 . toCommandValue ( message ) } ${ os . EOL } ` , {
257
+ encoding : 'utf8'
258
+ } ) ;
259
+ }
260
+ exports . issueCommand = issueCommand ;
261
+ //# sourceMappingURL=file-command.js.map
262
+
263
+ /***/ } ) ,
264
+
203
265
/***/ 127 :
204
266
/***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
205
267
@@ -1372,6 +1434,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
1372
1434
} ;
1373
1435
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1374
1436
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
1437
+ const utils_1 = __webpack_require__ ( 82 ) ;
1375
1438
/**
1376
1439
* Commands
1377
1440
*
@@ -1425,28 +1488,14 @@ class Command {
1425
1488
return cmdStr ;
1426
1489
}
1427
1490
}
1428
- /**
1429
- * Sanitizes an input into a string so it can be passed into issueCommand safely
1430
- * @param input input to sanitize into a string
1431
- */
1432
- function toCommandValue ( input ) {
1433
- if ( input === null || input === undefined ) {
1434
- return '' ;
1435
- }
1436
- else if ( typeof input === 'string' || input instanceof String ) {
1437
- return input ;
1438
- }
1439
- return JSON . stringify ( input );
1440
- }
1441
- exports . toCommandValue = toCommandValue ;
1442
1491
function escapeData ( s ) {
1443
- return toCommandValue ( s )
1492
+ return utils_1 . toCommandValue ( s )
1444
1493
. replace (/ % / g, '%25' )
1445
1494
. replace ( / \r / g, '%0D' )
1446
1495
. replace ( / \n / g, '%0A' ) ;
1447
1496
}
1448
1497
function escapeProperty ( s ) {
1449
- return toCommandValue ( s )
1498
+ return utils_1 . toCommandValue ( s )
1450
1499
. replace ( / % / g, '%25' )
1451
1500
. replace ( / \r / g, '%0D' )
1452
1501
. replace ( / \n / g, '%0A' )
@@ -3427,6 +3476,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
3427
3476
} ;
3428
3477
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
3429
3478
const command_1 = __webpack_require__ ( 431 ) ;
3479
+ const file_command_1 = __webpack_require__ ( 102 ) ;
3480
+ const utils_1 = __webpack_require__ ( 82 ) ;
3430
3481
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
3431
3482
const path = __importStar ( __webpack_require__ ( 622 ) ) ;
3432
3483
/**
@@ -3453,9 +3504,17 @@ var ExitCode;
3453
3504
*/
3454
3505
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3455
3506
function exportVariable ( name , val ) {
3456
- const convertedVal = command_1 . toCommandValue ( val ) ;
3507
+ const convertedVal = utils_1 . toCommandValue ( val ) ;
3457
3508
process . env [ name ] = convertedVal ;
3458
- command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
3509
+ const filePath = process . env [ 'GITHUB_ENV' ] || '' ;
3510
+ if ( filePath ) {
3511
+ const delimiter = '_GitHubActionsFileCommandDelimeter_' ;
3512
+ const commandValue = `${ name } <<${ delimiter } ${ os . EOL } ${ convertedVal } ${ os . EOL } ${ delimiter } ` ;
3513
+ file_command_1 . issueCommand ( 'ENV' , commandValue ) ;
3514
+ }
3515
+ else {
3516
+ command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
3517
+ }
3459
3518
}
3460
3519
exports . exportVariable = exportVariable ;
3461
3520
/**
@@ -3471,7 +3530,13 @@ exports.setSecret = setSecret;
3471
3530
* @param inputPath
3472
3531
*/
3473
3532
function addPath ( inputPath ) {
3474
- command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
3533
+ const filePath = process . env [ 'GITHUB_PATH' ] || '' ;
3534
+ if ( filePath ) {
3535
+ file_command_1 . issueCommand ( 'PATH' , inputPath ) ;
3536
+ }
3537
+ else {
3538
+ command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
3539
+ }
3475
3540
process . env [ 'PATH' ] = `${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
3476
3541
}
3477
3542
exports . addPath = addPath ;
@@ -6175,7 +6240,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
6175
6240
var request = __webpack_require__ ( 753 ) ;
6176
6241
var universalUserAgent = __webpack_require__ ( 796 ) ;
6177
6242
6178
- const VERSION = "4.5.6 " ;
6243
+ const VERSION = "4.5.7 " ;
6179
6244
6180
6245
class GraphqlError extends Error {
6181
6246
constructor ( request , response ) {
0 commit comments