@@ -1875,6 +1875,32 @@ const windowsRelease = release => {
1875
1875
module . exports = windowsRelease ;
1876
1876
1877
1877
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
+
1878
1904
/***/ } ) ,
1879
1905
1880
1906
/***/ 87 :
@@ -1884,6 +1910,42 @@ module.exports = require("os");
1884
1910
1885
1911
/***/ } ) ,
1886
1912
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
+
1887
1949
/***/ 118 :
1888
1950
/***/ ( function ( module , __unusedexports , __webpack_require__ ) {
1889
1951
@@ -3496,6 +3558,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
3496
3558
} ;
3497
3559
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
3498
3560
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
3561
+ const utils_1 = __webpack_require__ ( 82 ) ;
3499
3562
/**
3500
3563
* Commands
3501
3564
*
@@ -3549,28 +3612,14 @@ class Command {
3549
3612
return cmdStr ;
3550
3613
}
3551
3614
}
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 ;
3566
3615
function escapeData ( s ) {
3567
- return toCommandValue ( s )
3616
+ return utils_1 . toCommandValue ( s )
3568
3617
. replace ( / % / g, '%25' )
3569
3618
. replace ( / \r / g, '%0D' )
3570
3619
. replace ( / \n / g, '%0A' ) ;
3571
3620
}
3572
3621
function escapeProperty ( s ) {
3573
- return toCommandValue ( s )
3622
+ return utils_1 . toCommandValue ( s )
3574
3623
. replace ( / % / g, '%25' )
3575
3624
. replace ( / \r / g, '%0D' )
3576
3625
. replace ( / \n / g, '%0A' )
@@ -4324,6 +4373,12 @@ function convertBody(buffer, headers) {
4324
4373
// html4
4325
4374
if ( ! res && str ) {
4326
4375
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
+ }
4327
4382
4328
4383
if ( res ) {
4329
4384
res = / c h a r s e t = ( .* ) / i. exec ( res . pop ( ) ) ;
@@ -5331,7 +5386,7 @@ function fetch(url, opts) {
5331
5386
// HTTP fetch step 5.5
5332
5387
switch ( request . redirect ) {
5333
5388
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' ) ) ;
5335
5390
finalize ( ) ;
5336
5391
return ;
5337
5392
case 'manual' :
@@ -5370,7 +5425,8 @@ function fetch(url, opts) {
5370
5425
method : request . method ,
5371
5426
body : request . body ,
5372
5427
signal : request . signal ,
5373
- timeout : request . timeout
5428
+ timeout : request . timeout ,
5429
+ size : request . size
5374
5430
} ;
5375
5431
5376
5432
// HTTP-redirect fetch step 9
@@ -5685,6 +5741,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
5685
5741
} ;
5686
5742
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
5687
5743
const command_1 = __webpack_require__ ( 431 ) ;
5744
+ const file_command_1 = __webpack_require__ ( 102 ) ;
5745
+ const utils_1 = __webpack_require__ ( 82 ) ;
5688
5746
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
5689
5747
const path = __importStar ( __webpack_require__ ( 622 ) ) ;
5690
5748
/**
@@ -5711,9 +5769,17 @@ var ExitCode;
5711
5769
*/
5712
5770
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5713
5771
function exportVariable ( name , val ) {
5714
- const convertedVal = command_1 . toCommandValue ( val ) ;
5772
+ const convertedVal = utils_1 . toCommandValue ( val ) ;
5715
5773
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
+ }
5717
5783
}
5718
5784
exports . exportVariable = exportVariable ;
5719
5785
/**
@@ -5729,7 +5795,13 @@ exports.setSecret = setSecret;
5729
5795
* @param inputPath
5730
5796
*/
5731
5797
function 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
+ }
5733
5805
process . env [ 'PATH' ] = `${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
5734
5806
}
5735
5807
exports . addPath = addPath ;
0 commit comments