@@ -19,7 +19,13 @@ module.exports =
19
19
/******/ } ;
20
20
/******/
21
21
/******/ // Execute the module function
22
- /******/ modules [ moduleId ] . call ( module . exports , module , module . exports , __webpack_require__ ) ;
22
+ /******/ var threw = true ;
23
+ /******/ try {
24
+ /******/ modules [ moduleId ] . call ( module . exports , module , module . exports , __webpack_require__ ) ;
25
+ /******/ threw = false ;
26
+ /******/ } finally {
27
+ /******/ if ( threw ) delete installedModules [ moduleId ] ;
28
+ /******/ }
23
29
/******/
24
30
/******/ // Flag the module as loaded
25
31
/******/ module . l = true ;
@@ -34,7 +40,7 @@ module.exports =
34
40
/******/ // the startup function
35
41
/******/ function startup ( ) {
36
42
/******/ // Load entry module and return exports
37
- /******/ return __webpack_require__ ( 794 ) ;
43
+ /******/ return __webpack_require__ ( 464 ) ;
38
44
/******/ } ;
39
45
/******/
40
46
/******/ // run startup
@@ -43,7 +49,83 @@ module.exports =
43
49
/************************************************************************/
44
50
/******/ ( {
45
51
46
- /***/ 68 :
52
+ /***/ 87 :
53
+ /***/ ( function ( module ) {
54
+
55
+ module . exports = require ( "os" ) ;
56
+
57
+ /***/ } ) ,
58
+
59
+ /***/ 129 :
60
+ /***/ ( function ( module ) {
61
+
62
+ module . exports = require ( "child_process" ) ;
63
+
64
+ /***/ } ) ,
65
+
66
+ /***/ 143 :
67
+ /***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
68
+
69
+ "use strict" ;
70
+
71
+ // For internal use, subject to change.
72
+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
73
+ if ( mod && mod . __esModule ) return mod ;
74
+ var result = { } ;
75
+ if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
76
+ result [ "default" ] = mod ;
77
+ return result ;
78
+ } ;
79
+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
80
+ // We use any as a valid input type
81
+ /* eslint-disable @typescript-eslint/no-explicit-any */
82
+ const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
83
+ const os = __importStar ( __webpack_require__ ( 87 ) ) ;
84
+ const utils_1 = __webpack_require__ ( 166 ) ;
85
+ function issueCommand ( command , message ) {
86
+ const filePath = process . env [ `GITHUB_${ command } ` ] ;
87
+ if ( ! filePath ) {
88
+ throw new Error ( `Unable to find environment variable for file command ${ command } ` ) ;
89
+ }
90
+ if ( ! fs . existsSync ( filePath ) ) {
91
+ throw new Error ( `Missing file at path: ${ filePath } ` ) ;
92
+ }
93
+ fs . appendFileSync ( filePath , `${ utils_1 . toCommandValue ( message ) } ${ os . EOL } ` , {
94
+ encoding : 'utf8'
95
+ } ) ;
96
+ }
97
+ exports . issueCommand = issueCommand ;
98
+ //# sourceMappingURL=file-command.js.map
99
+
100
+ /***/ } ) ,
101
+
102
+ /***/ 166 :
103
+ /***/ ( function ( __unusedmodule , exports ) {
104
+
105
+ "use strict" ;
106
+
107
+ // We use any as a valid input type
108
+ /* eslint-disable @typescript-eslint/no-explicit-any */
109
+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
110
+ /**
111
+ * Sanitizes an input into a string so it can be passed into issueCommand safely
112
+ * @param input input to sanitize into a string
113
+ */
114
+ function toCommandValue ( input ) {
115
+ if ( input === null || input === undefined ) {
116
+ return '' ;
117
+ }
118
+ else if ( typeof input === 'string' || input instanceof String ) {
119
+ return input ;
120
+ }
121
+ return JSON . stringify ( input ) ;
122
+ }
123
+ exports . toCommandValue = toCommandValue ;
124
+ //# sourceMappingURL=utils.js.map
125
+
126
+ /***/ } ) ,
127
+
128
+ /***/ 208 :
47
129
/***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
48
130
49
131
"use strict" ;
@@ -65,7 +147,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
65
147
return result ;
66
148
} ;
67
149
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
68
- const command_1 = __webpack_require__ ( 955 ) ;
150
+ const command_1 = __webpack_require__ ( 875 ) ;
151
+ const file_command_1 = __webpack_require__ ( 143 ) ;
152
+ const utils_1 = __webpack_require__ ( 166 ) ;
69
153
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
70
154
const path = __importStar ( __webpack_require__ ( 622 ) ) ;
71
155
/**
@@ -92,9 +176,17 @@ var ExitCode;
92
176
*/
93
177
// eslint-disable-next-line @typescript-eslint/no-explicit-any
94
178
function exportVariable ( name , val ) {
95
- const convertedVal = command_1 . toCommandValue ( val ) ;
179
+ const convertedVal = utils_1 . toCommandValue ( val ) ;
96
180
process . env [ name ] = convertedVal ;
97
- command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
181
+ const filePath = process . env [ 'GITHUB_ENV' ] || '' ;
182
+ if ( filePath ) {
183
+ const delimiter = '_GitHubActionsFileCommandDelimeter_' ;
184
+ const commandValue = `${ name } <<${ delimiter } ${ os . EOL } ${ convertedVal } ${ os . EOL } ${ delimiter } ` ;
185
+ file_command_1 . issueCommand ( 'ENV' , commandValue ) ;
186
+ }
187
+ else {
188
+ command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
189
+ }
98
190
}
99
191
exports . exportVariable = exportVariable ;
100
192
/**
@@ -110,7 +202,13 @@ exports.setSecret = setSecret;
110
202
* @param inputPath
111
203
*/
112
204
function addPath ( inputPath ) {
113
- command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
205
+ const filePath = process . env [ 'GITHUB_PATH' ] || '' ;
206
+ if ( filePath ) {
207
+ file_command_1 . issueCommand ( 'PATH' , inputPath ) ;
208
+ }
209
+ else {
210
+ command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
211
+ }
114
212
process . env [ 'PATH' ] = `${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
115
213
}
116
214
exports . addPath = addPath ;
@@ -272,31 +370,10 @@ exports.getState = getState;
272
370
273
371
/***/ } ) ,
274
372
275
- /***/ 87 :
276
- /***/ ( function ( module ) {
277
-
278
- module . exports = require ( "os" ) ;
279
-
280
- /***/ } ) ,
281
-
282
- /***/ 129 :
283
- /***/ ( function ( module ) {
284
-
285
- module . exports = require ( "child_process" ) ;
286
-
287
- /***/ } ) ,
288
-
289
- /***/ 622 :
290
- /***/ ( function ( module ) {
291
-
292
- module . exports = require ( "path" ) ;
293
-
294
- /***/ } ) ,
295
-
296
- /***/ 794 :
373
+ /***/ 464 :
297
374
/***/ ( function ( __unusedmodule , __unusedexports , __webpack_require__ ) {
298
375
299
- const core = __webpack_require__ ( 68 ) ;
376
+ const core = __webpack_require__ ( 208 ) ;
300
377
301
378
const { execSync } = __webpack_require__ ( 129 ) ;
302
379
@@ -326,7 +403,21 @@ console.log('Done; exiting.');
326
403
327
404
/***/ } ) ,
328
405
329
- /***/ 955 :
406
+ /***/ 622 :
407
+ /***/ ( function ( module ) {
408
+
409
+ module . exports = require ( "path" ) ;
410
+
411
+ /***/ } ) ,
412
+
413
+ /***/ 747 :
414
+ /***/ ( function ( module ) {
415
+
416
+ module . exports = require ( "fs" ) ;
417
+
418
+ /***/ } ) ,
419
+
420
+ /***/ 875 :
330
421
/***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
331
422
332
423
"use strict" ;
@@ -340,6 +431,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
340
431
} ;
341
432
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
342
433
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
434
+ const utils_1 = __webpack_require__ ( 166 ) ;
343
435
/**
344
436
* Commands
345
437
*
@@ -393,28 +485,14 @@ class Command {
393
485
return cmdStr ;
394
486
}
395
487
}
396
- /**
397
- * Sanitizes an input into a string so it can be passed into issueCommand safely
398
- * @param input input to sanitize into a string
399
- */
400
- function toCommandValue ( input ) {
401
- if ( input === null || input === undefined ) {
402
- return '' ;
403
- }
404
- else if ( typeof input === 'string' || input instanceof String ) {
405
- return input ;
406
- }
407
- return JSON . stringify ( input ) ;
408
- }
409
- exports . toCommandValue = toCommandValue ;
410
488
function escapeData ( s ) {
411
- return toCommandValue ( s )
489
+ return utils_1 . toCommandValue ( s )
412
490
. replace ( / % / g, '%25' )
413
491
. replace ( / \r / g, '%0D' )
414
492
. replace ( / \n / g, '%0A' ) ;
415
493
}
416
494
function escapeProperty ( s ) {
417
- return toCommandValue ( s )
495
+ return utils_1 . toCommandValue ( s )
418
496
. replace ( / % / g, '%25' )
419
497
. replace ( / \r / g, '%0D' )
420
498
. replace ( / \n / g, '%0A' )
0 commit comments