@@ -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,6 +750,42 @@ 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/***/ 209 :
760790/***/ ( function ( module , __unusedexports , __webpack_require__ ) {
761791
@@ -775,9 +805,28 @@ module.exports.catch(core.setFailed)
775805/***/ } ) ,
776806
777807/***/ 211 :
778- /***/ ( function ( module ) {
808+ /***/ ( function ( __unusedmodule , exports ) {
779809
780- module . exports = require ( "https" ) ;
810+ "use strict" ;
811+
812+ // We use any as a valid input type
813+ /* eslint-disable @typescript-eslint/no-explicit-any */
814+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
815+ /**
816+ * Sanitizes an input into a string so it can be passed into issueCommand safely
817+ * @param input input to sanitize into a string
818+ */
819+ function toCommandValue ( input ) {
820+ if ( input === null || input === undefined ) {
821+ return '' ;
822+ }
823+ else if ( typeof input === 'string' || input instanceof String ) {
824+ return input ;
825+ }
826+ return JSON . stringify ( input ) ;
827+ }
828+ exports . toCommandValue = toCommandValue ;
829+ //# sourceMappingURL=utils.js.map
781830
782831/***/ } ) ,
783832
@@ -1503,7 +1552,7 @@ module.exports = bytesToUuid;
15031552Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
15041553const url = __webpack_require__ ( 835 ) ;
15051554const http = __webpack_require__ ( 605 ) ;
1506- const https = __webpack_require__ ( 211 ) ;
1555+ const https = __webpack_require__ ( 34 ) ;
15071556const pm = __webpack_require__ ( 890 ) ;
15081557let tunnel ;
15091558var HttpCodes ;
@@ -3124,6 +3173,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
31243173} ;
31253174Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
31263175const command_1 = __webpack_require__ ( 17 ) ;
3176+ const file_command_1 = __webpack_require__ ( 156 ) ;
3177+ const utils_1 = __webpack_require__ ( 211 ) ;
31273178const os = __importStar ( __webpack_require__ ( 87 ) ) ;
31283179const path = __importStar ( __webpack_require__ ( 622 ) ) ;
31293180/**
@@ -3150,9 +3201,17 @@ var ExitCode;
31503201 */
31513202// eslint-disable-next-line @typescript-eslint/no-explicit-any
31523203function exportVariable ( name , val ) {
3153- const convertedVal = command_1 . toCommandValue ( val ) ;
3204+ const convertedVal = utils_1 . toCommandValue ( val ) ;
31543205 process . env [ name ] = convertedVal ;
3155- command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
3206+ const filePath = process . env [ 'GITHUB_ENV' ] || '' ;
3207+ if ( filePath ) {
3208+ const delimiter = '_GitHubActionsFileCommandDelimeter_' ;
3209+ const commandValue = `${ name } <<${ delimiter } ${ os . EOL } ${ convertedVal } ${ os . EOL } ${ delimiter } ` ;
3210+ file_command_1 . issueCommand ( 'ENV' , commandValue ) ;
3211+ }
3212+ else {
3213+ command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
3214+ }
31563215}
31573216exports . exportVariable = exportVariable ;
31583217/**
@@ -3168,7 +3227,13 @@ exports.setSecret = setSecret;
31683227 * @param inputPath
31693228 */
31703229function addPath ( inputPath ) {
3171- command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
3230+ const filePath = process . env [ 'GITHUB_PATH' ] || '' ;
3231+ if ( filePath ) {
3232+ file_command_1 . issueCommand ( 'PATH' , inputPath ) ;
3233+ }
3234+ else {
3235+ command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
3236+ }
31723237 process . env [ 'PATH' ] = `${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
31733238}
31743239exports . addPath = addPath ;
0 commit comments