@@ -19,7 +19,13 @@ module.exports =
1919/******/ } ;
2020/******/
2121/******/ // 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+ /******/ }
2329/******/
2430/******/ // Flag the module as loaded
2531/******/ module . l = true ;
@@ -34,7 +40,7 @@ module.exports =
3440/******/ // the startup function
3541/******/ function startup ( ) {
3642/******/ // Load entry module and return exports
37- /******/ return __webpack_require__ ( 794 ) ;
43+ /******/ return __webpack_require__ ( 464 ) ;
3844/******/ } ;
3945/******/
4046/******/ // run startup
@@ -43,7 +49,83 @@ module.exports =
4349/************************************************************************/
4450/******/ ( {
4551
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 :
47129/***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
48130
49131"use strict" ;
@@ -65,7 +147,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
65147 return result ;
66148} ;
67149Object . 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 ) ;
69153const os = __importStar ( __webpack_require__ ( 87 ) ) ;
70154const path = __importStar ( __webpack_require__ ( 622 ) ) ;
71155/**
@@ -92,9 +176,17 @@ var ExitCode;
92176 */
93177// eslint-disable-next-line @typescript-eslint/no-explicit-any
94178function exportVariable ( name , val ) {
95- const convertedVal = command_1 . toCommandValue ( val ) ;
179+ const convertedVal = utils_1 . toCommandValue ( val ) ;
96180 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+ }
98190}
99191exports . exportVariable = exportVariable ;
100192/**
@@ -110,7 +202,13 @@ exports.setSecret = setSecret;
110202 * @param inputPath
111203 */
112204function 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+ }
114212 process . env [ 'PATH' ] = `${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
115213}
116214exports . addPath = addPath ;
@@ -272,31 +370,10 @@ exports.getState = getState;
272370
273371/***/ } ) ,
274372
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 :
297374/***/ ( function ( __unusedmodule , __unusedexports , __webpack_require__ ) {
298375
299- const core = __webpack_require__ ( 68 ) ;
376+ const core = __webpack_require__ ( 208 ) ;
300377
301378const { execSync } = __webpack_require__ ( 129 ) ;
302379
@@ -326,7 +403,21 @@ console.log('Done; exiting.');
326403
327404/***/ } ) ,
328405
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 :
330421/***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
331422
332423"use strict" ;
@@ -340,6 +431,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
340431} ;
341432Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
342433const os = __importStar ( __webpack_require__ ( 87 ) ) ;
434+ const utils_1 = __webpack_require__ ( 166 ) ;
343435/**
344436 * Commands
345437 *
@@ -393,28 +485,14 @@ class Command {
393485 return cmdStr ;
394486 }
395487}
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 ;
410488function escapeData ( s ) {
411- return toCommandValue ( s )
489+ return utils_1 . toCommandValue ( s )
412490 . replace ( / % / g, '%25' )
413491 . replace ( / \r / g, '%0D' )
414492 . replace ( / \n / g, '%0A' ) ;
415493}
416494function escapeProperty ( s ) {
417- return toCommandValue ( s )
495+ return utils_1 . toCommandValue ( s )
418496 . replace ( / % / g, '%25' )
419497 . replace ( / \r / g, '%0D' )
420498 . replace ( / \n / g, '%0A' )
0 commit comments