@@ -19,7 +19,13 @@ module.exports =
19
19
/******/ } ;
20
20
/******/
21
21
/******/ // 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
+ /******/ }
23
29
/******/
24
30
/******/ // Flag the module as loaded
25
31
/******/ module . l = true ;
@@ -2789,6 +2795,32 @@ function parse(src) {
2789
2795
exports . parse = parse ;
2790
2796
2791
2797
2798
+ /***/ } ) ,
2799
+
2800
+ /***/ 82 :
2801
+ /***/ ( function ( __unusedmodule , exports ) {
2802
+
2803
+ "use strict" ;
2804
+
2805
+ // We use any as a valid input type
2806
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2807
+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
2808
+ /**
2809
+ * Sanitizes an input into a string so it can be passed into issueCommand safely
2810
+ * @param input input to sanitize into a string
2811
+ */
2812
+ function toCommandValue ( input ) {
2813
+ if ( input === null || input === undefined ) {
2814
+ return '' ;
2815
+ }
2816
+ else if ( typeof input === 'string' || input instanceof String ) {
2817
+ return input ;
2818
+ }
2819
+ return JSON . stringify ( input ) ;
2820
+ }
2821
+ exports . toCommandValue = toCommandValue ;
2822
+ //# sourceMappingURL=utils.js.map
2823
+
2792
2824
/***/ } ) ,
2793
2825
2794
2826
/***/ 87 :
@@ -3726,6 +3758,42 @@ function regExpEscape (s) {
3726
3758
}
3727
3759
3728
3760
3761
+ /***/ } ) ,
3762
+
3763
+ /***/ 102 :
3764
+ /***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
3765
+
3766
+ "use strict" ;
3767
+
3768
+ // For internal use, subject to change.
3769
+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
3770
+ if ( mod && mod . __esModule ) return mod ;
3771
+ var result = { } ;
3772
+ if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
3773
+ result [ "default" ] = mod ;
3774
+ return result ;
3775
+ } ;
3776
+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
3777
+ // We use any as a valid input type
3778
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3779
+ const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
3780
+ const os = __importStar ( __webpack_require__ ( 87 ) ) ;
3781
+ const utils_1 = __webpack_require__ ( 82 ) ;
3782
+ function issueCommand ( command , message ) {
3783
+ const filePath = process . env [ `GITHUB_${ command } ` ] ;
3784
+ if ( ! filePath ) {
3785
+ throw new Error ( `Unable to find environment variable for file command ${ command } ` ) ;
3786
+ }
3787
+ if ( ! fs . existsSync ( filePath ) ) {
3788
+ throw new Error ( `Missing file at path: ${ filePath } ` ) ;
3789
+ }
3790
+ fs . appendFileSync ( filePath , `${ utils_1 . toCommandValue ( message ) } ${ os . EOL } ` , {
3791
+ encoding : 'utf8'
3792
+ } ) ;
3793
+ }
3794
+ exports . issueCommand = issueCommand ;
3795
+ //# sourceMappingURL=file-command.js.map
3796
+
3729
3797
/***/ } ) ,
3730
3798
3731
3799
/***/ 117 :
@@ -7761,7 +7829,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
7761
7829
var __importStar = ( this && this . __importStar ) || function ( mod ) {
7762
7830
if ( mod && mod . __esModule ) return mod ;
7763
7831
var result = { } ;
7764
- if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
7832
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
7765
7833
__setModuleDefault ( result , mod ) ;
7766
7834
return result ;
7767
7835
} ;
@@ -8606,6 +8674,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
8606
8674
} ;
8607
8675
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
8608
8676
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
8677
+ const utils_1 = __webpack_require__ ( 82 ) ;
8609
8678
/**
8610
8679
* Commands
8611
8680
*
@@ -8660,13 +8729,13 @@ class Command {
8660
8729
}
8661
8730
}
8662
8731
function escapeData ( s ) {
8663
- return ( s || '' )
8732
+ return utils_1 . toCommandValue ( s )
8664
8733
. replace ( / % / g, '%25' )
8665
8734
. replace ( / \r / g, '%0D' )
8666
8735
. replace ( / \n / g, '%0A' ) ;
8667
8736
}
8668
8737
function escapeProperty ( s ) {
8669
- return ( s || '' )
8738
+ return utils_1 . toCommandValue ( s )
8670
8739
. replace ( / % / g, '%25' )
8671
8740
. replace ( / \r / g, '%0D' )
8672
8741
. replace ( / \n / g, '%0A' )
@@ -8700,6 +8769,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
8700
8769
} ;
8701
8770
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
8702
8771
const command_1 = __webpack_require__ ( 431 ) ;
8772
+ const file_command_1 = __webpack_require__ ( 102 ) ;
8773
+ const utils_1 = __webpack_require__ ( 82 ) ;
8703
8774
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
8704
8775
const path = __importStar ( __webpack_require__ ( 622 ) ) ;
8705
8776
/**
@@ -8722,11 +8793,21 @@ var ExitCode;
8722
8793
/**
8723
8794
* Sets env variable for this action and future actions in the job
8724
8795
* @param name the name of the variable to set
8725
- * @param val the value of the variable
8796
+ * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
8726
8797
*/
8798
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8727
8799
function exportVariable ( name , val ) {
8728
- process . env [ name ] = val ;
8729
- command_1 . issueCommand ( 'set-env' , { name } , val ) ;
8800
+ const convertedVal = utils_1 . toCommandValue ( val ) ;
8801
+ process . env [ name ] = convertedVal ;
8802
+ const filePath = process . env [ 'GITHUB_ENV' ] || '' ;
8803
+ if ( filePath ) {
8804
+ const delimiter = '_GitHubActionsFileCommandDelimeter_' ;
8805
+ const commandValue = `${ name } <<${ delimiter } ${ os . EOL } ${ convertedVal } ${ os . EOL } ${ delimiter } ` ;
8806
+ file_command_1 . issueCommand ( 'ENV' , commandValue ) ;
8807
+ }
8808
+ else {
8809
+ command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
8810
+ }
8730
8811
}
8731
8812
exports . exportVariable = exportVariable ;
8732
8813
/**
@@ -8742,7 +8823,13 @@ exports.setSecret = setSecret;
8742
8823
* @param inputPath
8743
8824
*/
8744
8825
function addPath ( inputPath ) {
8745
- command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
8826
+ const filePath = process . env [ 'GITHUB_PATH' ] || '' ;
8827
+ if ( filePath ) {
8828
+ file_command_1 . issueCommand ( 'PATH' , inputPath ) ;
8829
+ }
8830
+ else {
8831
+ command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
8832
+ }
8746
8833
process . env [ 'PATH' ] = `${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
8747
8834
}
8748
8835
exports . addPath = addPath ;
@@ -8765,12 +8852,22 @@ exports.getInput = getInput;
8765
8852
* Sets the value of an output.
8766
8853
*
8767
8854
* @param name name of the output to set
8768
- * @param value value to store
8855
+ * @param value value to store. Non-string values will be converted to a string via JSON.stringify
8769
8856
*/
8857
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8770
8858
function setOutput ( name , value ) {
8771
8859
command_1 . issueCommand ( 'set-output' , { name } , value ) ;
8772
8860
}
8773
8861
exports . setOutput = setOutput ;
8862
+ /**
8863
+ * Enables or disables the echoing of commands into stdout for the rest of the step.
8864
+ * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
8865
+ *
8866
+ */
8867
+ function setCommandEcho ( enabled ) {
8868
+ command_1 . issue ( 'echo' , enabled ? 'on' : 'off' ) ;
8869
+ }
8870
+ exports . setCommandEcho = setCommandEcho ;
8774
8871
//-----------------------------------------------------------------------
8775
8872
// Results
8776
8873
//-----------------------------------------------------------------------
@@ -8804,18 +8901,18 @@ function debug(message) {
8804
8901
exports . debug = debug ;
8805
8902
/**
8806
8903
* Adds an error issue
8807
- * @param message error issue message
8904
+ * @param message error issue message. Errors will be converted to string via toString()
8808
8905
*/
8809
8906
function error ( message ) {
8810
- command_1 . issue ( 'error' , message ) ;
8907
+ command_1 . issue ( 'error' , message instanceof Error ? message . toString ( ) : message ) ;
8811
8908
}
8812
8909
exports . error = error ;
8813
8910
/**
8814
8911
* Adds an warning issue
8815
- * @param message warning issue message
8912
+ * @param message warning issue message. Errors will be converted to string via toString()
8816
8913
*/
8817
8914
function warning ( message ) {
8818
- command_1 . issue ( 'warning' , message ) ;
8915
+ command_1 . issue ( 'warning' , message instanceof Error ? message . toString ( ) : message ) ;
8819
8916
}
8820
8917
exports . warning = warning ;
8821
8918
/**
@@ -8873,8 +8970,9 @@ exports.group = group;
8873
8970
* Saves state for current action, the state can only be retrieved by this action's post job execution.
8874
8971
*
8875
8972
* @param name name of the state to store
8876
- * @param value value to store
8973
+ * @param value value to store. Non-string values will be converted to a string via JSON.stringify
8877
8974
*/
8975
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8878
8976
function saveState ( name , value ) {
8879
8977
command_1 . issueCommand ( 'save-state' , { name } , value ) ;
8880
8978
}
@@ -11882,7 +11980,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
11882
11980
var __importStar = ( this && this . __importStar ) || function ( mod ) {
11883
11981
if ( mod && mod . __esModule ) return mod ;
11884
11982
var result = { } ;
11885
- if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
11983
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
11886
11984
__setModuleDefault ( result , mod ) ;
11887
11985
return result ;
11888
11986
} ;
0 commit comments