@@ -272,6 +272,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
272272} ;
273273Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
274274const os = __importStar ( __webpack_require__ ( 87 ) ) ;
275+ const utils_1 = __webpack_require__ ( 211 ) ;
275276/**
276277 * Commands
277278 *
@@ -325,28 +326,14 @@ class Command {
325326 return cmdStr ;
326327 }
327328}
328- /**
329- * Sanitizes an input into a string so it can be passed into issueCommand safely
330- * @param input input to sanitize into a string
331- */
332- function toCommandValue ( input ) {
333- if ( input === null || input === undefined ) {
334- return '' ;
335- }
336- else if ( typeof input === 'string' || input instanceof String ) {
337- return input ;
338- }
339- return JSON . stringify ( input ) ;
340- }
341- exports . toCommandValue = toCommandValue ;
342329function escapeData ( s ) {
343- return toCommandValue ( s )
330+ return utils_1 . toCommandValue ( s )
344331 . replace ( / % / g, '%25' )
345332 . replace ( / \r / g, '%0D' )
346333 . replace ( / \n / g, '%0A' ) ;
347334}
348335function escapeProperty ( s ) {
349- return toCommandValue ( s )
336+ return utils_1 . toCommandValue ( s )
350337 . replace ( / % / g, '%25' )
351338 . replace ( / \r / g, '%0D' )
352339 . replace ( / \n / g, '%0A' )
@@ -470,6 +457,13 @@ exports._readLinuxVersionFile = _readLinuxVersionFile;
470457
471458/***/ } ) ,
472459
460+ /***/ 34 :
461+ /***/ ( function ( module ) {
462+
463+ module . exports = require ( "https" ) ;
464+
465+ /***/ } ) ,
466+
473467/***/ 87 :
474468/***/ ( function ( module ) {
475469
@@ -486,7 +480,7 @@ module.exports = require("os");
486480var net = __webpack_require__ ( 631 ) ;
487481var tls = __webpack_require__ ( 16 ) ;
488482var http = __webpack_require__ ( 605 ) ;
489- var https = __webpack_require__ ( 211 ) ;
483+ var https = __webpack_require__ ( 34 ) ;
490484var events = __webpack_require__ ( 614 ) ;
491485var assert = __webpack_require__ ( 357 ) ;
492486var util = __webpack_require__ ( 669 ) ;
@@ -756,10 +750,65 @@ module.exports = require("child_process");
756750
757751/***/ } ) ,
758752
753+ /***/ 156 :
754+ /***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
755+
756+ "use strict" ;
757+
758+ // For internal use, subject to change.
759+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
760+ if ( mod && mod . __esModule ) return mod ;
761+ var result = { } ;
762+ if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
763+ result [ "default" ] = mod ;
764+ return result ;
765+ } ;
766+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
767+ // We use any as a valid input type
768+ /* eslint-disable @typescript-eslint/no-explicit-any */
769+ const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
770+ const os = __importStar ( __webpack_require__ ( 87 ) ) ;
771+ const utils_1 = __webpack_require__ ( 211 ) ;
772+ function issueCommand ( command , message ) {
773+ const filePath = process . env [ `GITHUB_${ command } ` ] ;
774+ if ( ! filePath ) {
775+ throw new Error ( `Unable to find environment variable for file command ${ command } ` ) ;
776+ }
777+ if ( ! fs . existsSync ( filePath ) ) {
778+ throw new Error ( `Missing file at path: ${ filePath } ` ) ;
779+ }
780+ fs . appendFileSync ( filePath , `${ utils_1 . toCommandValue ( message ) } ${ os . EOL } ` , {
781+ encoding : 'utf8'
782+ } ) ;
783+ }
784+ exports . issueCommand = issueCommand ;
785+ //# sourceMappingURL=file-command.js.map
786+
787+ /***/ } ) ,
788+
759789/***/ 211 :
760- /***/ ( function ( module ) {
790+ /***/ ( function ( __unusedmodule , exports ) {
761791
762- module . exports = require ( "https" ) ;
792+ "use strict" ;
793+
794+ // We use any as a valid input type
795+ /* eslint-disable @typescript-eslint/no-explicit-any */
796+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
797+ /**
798+ * Sanitizes an input into a string so it can be passed into issueCommand safely
799+ * @param input input to sanitize into a string
800+ */
801+ function toCommandValue ( input ) {
802+ if ( input === null || input === undefined ) {
803+ return '' ;
804+ }
805+ else if ( typeof input === 'string' || input instanceof String ) {
806+ return input ;
807+ }
808+ return JSON . stringify ( input ) ;
809+ }
810+ exports . toCommandValue = toCommandValue ;
811+ //# sourceMappingURL=utils.js.map
763812
764813/***/ } ) ,
765814
@@ -1452,7 +1501,7 @@ module.exports = bytesToUuid;
14521501Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
14531502const url = __webpack_require__ ( 835 ) ;
14541503const http = __webpack_require__ ( 605 ) ;
1455- const https = __webpack_require__ ( 211 ) ;
1504+ const https = __webpack_require__ ( 34 ) ;
14561505const pm = __webpack_require__ ( 890 ) ;
14571506let tunnel ;
14581507var HttpCodes ;
@@ -3104,6 +3153,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
31043153} ;
31053154Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
31063155const command_1 = __webpack_require__ ( 17 ) ;
3156+ const file_command_1 = __webpack_require__ ( 156 ) ;
3157+ const utils_1 = __webpack_require__ ( 211 ) ;
31073158const os = __importStar ( __webpack_require__ ( 87 ) ) ;
31083159const path = __importStar ( __webpack_require__ ( 622 ) ) ;
31093160/**
@@ -3130,9 +3181,17 @@ var ExitCode;
31303181 */
31313182// eslint-disable-next-line @typescript-eslint/no-explicit-any
31323183function exportVariable ( name , val ) {
3133- const convertedVal = command_1 . toCommandValue ( val ) ;
3184+ const convertedVal = utils_1 . toCommandValue ( val ) ;
31343185 process . env [ name ] = convertedVal ;
3135- command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
3186+ const filePath = process . env [ 'GITHUB_ENV' ] || '' ;
3187+ if ( filePath ) {
3188+ const delimiter = '_GitHubActionsFileCommandDelimeter_' ;
3189+ const commandValue = `${ name } <<${ delimiter } ${ os . EOL } ${ convertedVal } ${ os . EOL } ${ delimiter } ` ;
3190+ file_command_1 . issueCommand ( 'ENV' , commandValue ) ;
3191+ }
3192+ else {
3193+ command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
3194+ }
31363195}
31373196exports . exportVariable = exportVariable ;
31383197/**
@@ -3148,7 +3207,13 @@ exports.setSecret = setSecret;
31483207 * @param inputPath
31493208 */
31503209function addPath ( inputPath ) {
3151- command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
3210+ const filePath = process . env [ 'GITHUB_PATH' ] || '' ;
3211+ if ( filePath ) {
3212+ file_command_1 . issueCommand ( 'PATH' , inputPath ) ;
3213+ }
3214+ else {
3215+ command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
3216+ }
31523217 process . env [ 'PATH' ] = `${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
31533218}
31543219exports . addPath = addPath ;
0 commit comments