@@ -191,6 +191,32 @@ function onceStrict (fn) {
191191}
192192
193193
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+
194220/***/ } ) ,
195221
196222/***/ 87 :
@@ -200,6 +226,42 @@ module.exports = require("os");
200226
201227/***/ } ) ,
202228
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+
203265/***/ 127 :
204266/***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
205267
@@ -1372,6 +1434,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
13721434} ;
13731435Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
13741436const os = __importStar ( __webpack_require__ ( 87 ) ) ;
1437+ const utils_1 = __webpack_require__ ( 82 ) ;
13751438/**
13761439 * Commands
13771440 *
@@ -1425,28 +1488,14 @@ class Command {
14251488 return cmdStr ;
14261489 }
14271490}
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 ;
14421491function escapeData ( s ) {
1443- return toCommandValue ( s )
1492+ return utils_1 . toCommandValue ( s )
14441493 . replace ( / % / g, '%25' )
14451494 . replace ( / \r / g, '%0D' )
14461495 . replace ( / \n / g, '%0A' ) ;
14471496}
14481497function escapeProperty ( s ) {
1449- return toCommandValue ( s )
1498+ return utils_1 . toCommandValue ( s )
14501499 . replace ( / % / g, '%25' )
14511500 . replace ( / \r / g, '%0D' )
14521501 . replace ( / \n / g, '%0A' )
@@ -3427,6 +3476,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
34273476} ;
34283477Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
34293478const command_1 = __webpack_require__ ( 431 ) ;
3479+ const file_command_1 = __webpack_require__ ( 102 ) ;
3480+ const utils_1 = __webpack_require__ ( 82 ) ;
34303481const os = __importStar ( __webpack_require__ ( 87 ) ) ;
34313482const path = __importStar ( __webpack_require__ ( 622 ) ) ;
34323483/**
@@ -3453,9 +3504,17 @@ var ExitCode;
34533504 */
34543505// eslint-disable-next-line @typescript-eslint/no-explicit-any
34553506function exportVariable ( name , val ) {
3456- const convertedVal = command_1 . toCommandValue ( val ) ;
3507+ const convertedVal = utils_1 . toCommandValue ( val ) ;
34573508 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+ }
34593518}
34603519exports . exportVariable = exportVariable ;
34613520/**
@@ -3471,7 +3530,13 @@ exports.setSecret = setSecret;
34713530 * @param inputPath
34723531 */
34733532function 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+ }
34753540 process . env [ 'PATH' ] = `${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
34763541}
34773542exports . addPath = addPath ;
@@ -6175,7 +6240,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
61756240var request = __webpack_require__ ( 753 ) ;
61766241var universalUserAgent = __webpack_require__ ( 796 ) ;
61776242
6178- const VERSION = "4.5.6 " ;
6243+ const VERSION = "4.5.7 " ;
61796244
61806245class GraphqlError extends Error {
61816246 constructor ( request , response ) {
0 commit comments