@@ -1875,6 +1875,32 @@ const windowsRelease = release => {
18751875module . exports = windowsRelease ;
18761876
18771877
1878+ /***/ } ) ,
1879+
1880+ /***/ 82 :
1881+ /***/ ( function ( __unusedmodule , exports ) {
1882+
1883+ "use strict" ;
1884+
1885+ // We use any as a valid input type
1886+ /* eslint-disable @typescript-eslint/no-explicit-any */
1887+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1888+ /**
1889+ * Sanitizes an input into a string so it can be passed into issueCommand safely
1890+ * @param input input to sanitize into a string
1891+ */
1892+ function toCommandValue ( input ) {
1893+ if ( input === null || input === undefined ) {
1894+ return '' ;
1895+ }
1896+ else if ( typeof input === 'string' || input instanceof String ) {
1897+ return input ;
1898+ }
1899+ return JSON . stringify ( input ) ;
1900+ }
1901+ exports . toCommandValue = toCommandValue ;
1902+ //# sourceMappingURL=utils.js.map
1903+
18781904/***/ } ) ,
18791905
18801906/***/ 87 :
@@ -1884,6 +1910,42 @@ module.exports = require("os");
18841910
18851911/***/ } ) ,
18861912
1913+ /***/ 102 :
1914+ /***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
1915+
1916+ "use strict" ;
1917+
1918+ // For internal use, subject to change.
1919+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
1920+ if ( mod && mod . __esModule ) return mod ;
1921+ var result = { } ;
1922+ if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
1923+ result [ "default" ] = mod ;
1924+ return result ;
1925+ } ;
1926+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1927+ // We use any as a valid input type
1928+ /* eslint-disable @typescript-eslint/no-explicit-any */
1929+ const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
1930+ const os = __importStar ( __webpack_require__ ( 87 ) ) ;
1931+ const utils_1 = __webpack_require__ ( 82 ) ;
1932+ function issueCommand ( command , message ) {
1933+ const filePath = process . env [ `GITHUB_${ command } ` ] ;
1934+ if ( ! filePath ) {
1935+ throw new Error ( `Unable to find environment variable for file command ${ command } ` ) ;
1936+ }
1937+ if ( ! fs . existsSync ( filePath ) ) {
1938+ throw new Error ( `Missing file at path: ${ filePath } ` ) ;
1939+ }
1940+ fs . appendFileSync ( filePath , `${ utils_1 . toCommandValue ( message ) } ${ os . EOL } ` , {
1941+ encoding : 'utf8'
1942+ } ) ;
1943+ }
1944+ exports . issueCommand = issueCommand ;
1945+ //# sourceMappingURL=file-command.js.map
1946+
1947+ /***/ } ) ,
1948+
18871949/***/ 118 :
18881950/***/ ( function ( module , __unusedexports , __webpack_require__ ) {
18891951
@@ -3496,6 +3558,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
34963558} ;
34973559Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
34983560const os = __importStar ( __webpack_require__ ( 87 ) ) ;
3561+ const utils_1 = __webpack_require__ ( 82 ) ;
34993562/**
35003563 * Commands
35013564 *
@@ -3549,28 +3612,14 @@ class Command {
35493612 return cmdStr ;
35503613 }
35513614}
3552- /**
3553- * Sanitizes an input into a string so it can be passed into issueCommand safely
3554- * @param input input to sanitize into a string
3555- */
3556- function toCommandValue ( input ) {
3557- if ( input === null || input === undefined ) {
3558- return '' ;
3559- }
3560- else if ( typeof input === 'string' || input instanceof String ) {
3561- return input ;
3562- }
3563- return JSON . stringify ( input ) ;
3564- }
3565- exports . toCommandValue = toCommandValue ;
35663615function escapeData ( s ) {
3567- return toCommandValue ( s )
3616+ return utils_1 . toCommandValue ( s )
35683617 . replace ( / % / g, '%25' )
35693618 . replace ( / \r / g, '%0D' )
35703619 . replace ( / \n / g, '%0A' ) ;
35713620}
35723621function escapeProperty ( s ) {
3573- return toCommandValue ( s )
3622+ return utils_1 . toCommandValue ( s )
35743623 . replace ( / % / g, '%25' )
35753624 . replace ( / \r / g, '%0D' )
35763625 . replace ( / \n / g, '%0A' )
@@ -4324,6 +4373,12 @@ function convertBody(buffer, headers) {
43244373 // html4
43254374 if ( ! res && str ) {
43264375 res = / < m e t a [ \s ] + ?h t t p - e q u i v = ( [ ' " ] ) c o n t e n t - t y p e \1[ \s ] + ?c o n t e n t = ( [ ' " ] ) ( .+ ?) \2/ i. exec ( str ) ;
4376+ if ( ! res ) {
4377+ res = / < m e t a [ \s ] + ?c o n t e n t = ( [ ' " ] ) ( .+ ?) \1[ \s ] + ?h t t p - e q u i v = ( [ ' " ] ) c o n t e n t - t y p e \3/ i. exec ( str ) ;
4378+ if ( res ) {
4379+ res . pop ( ) ; // drop last quote
4380+ }
4381+ }
43274382
43284383 if ( res ) {
43294384 res = / c h a r s e t = ( .* ) / i. exec ( res . pop ( ) ) ;
@@ -5331,7 +5386,7 @@ function fetch(url, opts) {
53315386 // HTTP fetch step 5.5
53325387 switch ( request . redirect ) {
53335388 case 'error' :
5334- reject ( new FetchError ( `redirect mode is set to error: ${ request . url } ` , 'no-redirect' ) ) ;
5389+ reject ( new FetchError ( `uri requested responds with a redirect, redirect mode is set to error: ${ request . url } ` , 'no-redirect' ) ) ;
53355390 finalize ( ) ;
53365391 return ;
53375392 case 'manual' :
@@ -5370,7 +5425,8 @@ function fetch(url, opts) {
53705425 method : request . method ,
53715426 body : request . body ,
53725427 signal : request . signal ,
5373- timeout : request . timeout
5428+ timeout : request . timeout ,
5429+ size : request . size
53745430 } ;
53755431
53765432 // HTTP-redirect fetch step 9
@@ -5685,6 +5741,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
56855741} ;
56865742Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
56875743const command_1 = __webpack_require__ ( 431 ) ;
5744+ const file_command_1 = __webpack_require__ ( 102 ) ;
5745+ const utils_1 = __webpack_require__ ( 82 ) ;
56885746const os = __importStar ( __webpack_require__ ( 87 ) ) ;
56895747const path = __importStar ( __webpack_require__ ( 622 ) ) ;
56905748/**
@@ -5711,9 +5769,17 @@ var ExitCode;
57115769 */
57125770// eslint-disable-next-line @typescript-eslint/no-explicit-any
57135771function exportVariable ( name , val ) {
5714- const convertedVal = command_1 . toCommandValue ( val ) ;
5772+ const convertedVal = utils_1 . toCommandValue ( val ) ;
57155773 process . env [ name ] = convertedVal ;
5716- command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
5774+ const filePath = process . env [ 'GITHUB_ENV' ] || '' ;
5775+ if ( filePath ) {
5776+ const delimiter = '_GitHubActionsFileCommandDelimeter_' ;
5777+ const commandValue = `${ name } <<${ delimiter } ${ os . EOL } ${ convertedVal } ${ os . EOL } ${ delimiter } ` ;
5778+ file_command_1 . issueCommand ( 'ENV' , commandValue ) ;
5779+ }
5780+ else {
5781+ command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
5782+ }
57175783}
57185784exports . exportVariable = exportVariable ;
57195785/**
@@ -5729,7 +5795,13 @@ exports.setSecret = setSecret;
57295795 * @param inputPath
57305796 */
57315797function addPath ( inputPath ) {
5732- command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
5798+ const filePath = process . env [ 'GITHUB_PATH' ] || '' ;
5799+ if ( filePath ) {
5800+ file_command_1 . issueCommand ( 'PATH' , inputPath ) ;
5801+ }
5802+ else {
5803+ command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
5804+ }
57335805 process . env [ 'PATH' ] = `${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
57345806}
57355807exports . addPath = addPath ;
0 commit comments