@@ -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 ;
@@ -354,13 +360,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
354
360
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
355
361
} ) ;
356
362
} ;
363
+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
364
+ if ( mod && mod . __esModule ) return mod ;
365
+ var result = { } ;
366
+ if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
367
+ result [ "default" ] = mod ;
368
+ return result ;
369
+ } ;
357
370
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
358
- const os = __webpack_require__ ( 87 ) ;
359
- const events = __webpack_require__ ( 614 ) ;
360
- const child = __webpack_require__ ( 129 ) ;
361
- const path = __webpack_require__ ( 622 ) ;
362
- const io = __webpack_require__ ( 1 ) ;
363
- const ioUtil = __webpack_require__ ( 672 ) ;
371
+ const os = __importStar ( __webpack_require__ ( 87 ) ) ;
372
+ const events = __importStar ( __webpack_require__ ( 614 ) ) ;
373
+ const child = __importStar ( __webpack_require__ ( 129 ) ) ;
374
+ const path = __importStar ( __webpack_require__ ( 622 ) ) ;
375
+ const io = __importStar ( __webpack_require__ ( 1 ) ) ;
376
+ const ioUtil = __importStar ( __webpack_require__ ( 672 ) ) ;
364
377
/* eslint-disable @typescript-eslint/unbound-method */
365
378
const IS_WINDOWS = process . platform === 'win32' ;
366
379
/*
@@ -804,6 +817,12 @@ class ToolRunner extends events.EventEmitter {
804
817
resolve ( exitCode ) ;
805
818
}
806
819
} ) ;
820
+ if ( this . options . input ) {
821
+ if ( ! cp . stdin ) {
822
+ throw new Error ( 'child process missing stdin' ) ;
823
+ }
824
+ cp . stdin . end ( this . options . input ) ;
825
+ }
807
826
} ) ;
808
827
} ) ;
809
828
}
@@ -934,13 +953,75 @@ class ExecState extends events.EventEmitter {
934
953
935
954
/***/ } ) ,
936
955
956
+ /***/ 82 :
957
+ /***/ ( function ( __unusedmodule , exports ) {
958
+
959
+ "use strict" ;
960
+
961
+ // We use any as a valid input type
962
+ /* eslint-disable @typescript-eslint/no-explicit-any */
963
+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
964
+ /**
965
+ * Sanitizes an input into a string so it can be passed into issueCommand safely
966
+ * @param input input to sanitize into a string
967
+ */
968
+ function toCommandValue ( input ) {
969
+ if ( input === null || input === undefined ) {
970
+ return '' ;
971
+ }
972
+ else if ( typeof input === 'string' || input instanceof String ) {
973
+ return input ;
974
+ }
975
+ return JSON . stringify ( input ) ;
976
+ }
977
+ exports . toCommandValue = toCommandValue ;
978
+ //# sourceMappingURL=utils.js.map
979
+
980
+ /***/ } ) ,
981
+
937
982
/***/ 87 :
938
983
/***/ ( function ( module ) {
939
984
940
985
module . exports = require ( "os" ) ;
941
986
942
987
/***/ } ) ,
943
988
989
+ /***/ 102 :
990
+ /***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
991
+
992
+ "use strict" ;
993
+
994
+ // For internal use, subject to change.
995
+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
996
+ if ( mod && mod . __esModule ) return mod ;
997
+ var result = { } ;
998
+ if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
999
+ result [ "default" ] = mod ;
1000
+ return result ;
1001
+ } ;
1002
+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1003
+ // We use any as a valid input type
1004
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1005
+ const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
1006
+ const os = __importStar ( __webpack_require__ ( 87 ) ) ;
1007
+ const utils_1 = __webpack_require__ ( 82 ) ;
1008
+ function issueCommand ( command , message ) {
1009
+ const filePath = process . env [ `GITHUB_${ command } ` ] ;
1010
+ if ( ! filePath ) {
1011
+ throw new Error ( `Unable to find environment variable for file command ${ command } ` ) ;
1012
+ }
1013
+ if ( ! fs . existsSync ( filePath ) ) {
1014
+ throw new Error ( `Missing file at path: ${ filePath } ` ) ;
1015
+ }
1016
+ fs . appendFileSync ( filePath , `${ utils_1 . toCommandValue ( message ) } ${ os . EOL } ` , {
1017
+ encoding : 'utf8'
1018
+ } ) ;
1019
+ }
1020
+ exports . issueCommand = issueCommand ;
1021
+ //# sourceMappingURL=file-command.js.map
1022
+
1023
+ /***/ } ) ,
1024
+
944
1025
/***/ 129 :
945
1026
/***/ ( function ( module ) {
946
1027
@@ -969,6 +1050,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
969
1050
} ;
970
1051
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
971
1052
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
1053
+ const utils_1 = __webpack_require__ ( 82 ) ;
972
1054
/**
973
1055
* Commands
974
1056
*
@@ -1023,13 +1105,13 @@ class Command {
1023
1105
}
1024
1106
}
1025
1107
function escapeData ( s ) {
1026
- return ( s || '' )
1108
+ return utils_1 . toCommandValue ( s )
1027
1109
. replace ( / % / g, '%25' )
1028
1110
. replace ( / \r / g, '%0D' )
1029
1111
. replace ( / \n / g, '%0A' ) ;
1030
1112
}
1031
1113
function escapeProperty ( s ) {
1032
- return ( s || '' )
1114
+ return utils_1 . toCommandValue ( s )
1033
1115
. replace ( / % / g, '%25' )
1034
1116
. replace ( / \r / g, '%0D' )
1035
1117
. replace ( / \n / g, '%0A' )
@@ -1063,6 +1145,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
1063
1145
} ;
1064
1146
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1065
1147
const command_1 = __webpack_require__ ( 431 ) ;
1148
+ const file_command_1 = __webpack_require__ ( 102 ) ;
1149
+ const utils_1 = __webpack_require__ ( 82 ) ;
1066
1150
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
1067
1151
const path = __importStar ( __webpack_require__ ( 622 ) ) ;
1068
1152
/**
@@ -1085,11 +1169,21 @@ var ExitCode;
1085
1169
/**
1086
1170
* Sets env variable for this action and future actions in the job
1087
1171
* @param name the name of the variable to set
1088
- * @param val the value of the variable
1172
+ * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
1089
1173
*/
1174
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1090
1175
function exportVariable ( name , val ) {
1091
- process . env [ name ] = val ;
1092
- command_1 . issueCommand ( 'set-env' , { name } , val ) ;
1176
+ const convertedVal = utils_1 . toCommandValue ( val ) ;
1177
+ process . env [ name ] = convertedVal ;
1178
+ const filePath = process . env [ 'GITHUB_ENV' ] || '' ;
1179
+ if ( filePath ) {
1180
+ const delimiter = '_GitHubActionsFileCommandDelimeter_' ;
1181
+ const commandValue = `${ name } <<${ delimiter } ${ os . EOL } ${ convertedVal } ${ os . EOL } ${ delimiter } ` ;
1182
+ file_command_1 . issueCommand ( 'ENV' , commandValue ) ;
1183
+ }
1184
+ else {
1185
+ command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
1186
+ }
1093
1187
}
1094
1188
exports . exportVariable = exportVariable ;
1095
1189
/**
@@ -1105,7 +1199,13 @@ exports.setSecret = setSecret;
1105
1199
* @param inputPath
1106
1200
*/
1107
1201
function addPath ( inputPath ) {
1108
- command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
1202
+ const filePath = process . env [ 'GITHUB_PATH' ] || '' ;
1203
+ if ( filePath ) {
1204
+ file_command_1 . issueCommand ( 'PATH' , inputPath ) ;
1205
+ }
1206
+ else {
1207
+ command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
1208
+ }
1109
1209
process . env [ 'PATH' ] = `${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
1110
1210
}
1111
1211
exports . addPath = addPath ;
@@ -1128,12 +1228,22 @@ exports.getInput = getInput;
1128
1228
* Sets the value of an output.
1129
1229
*
1130
1230
* @param name name of the output to set
1131
- * @param value value to store
1231
+ * @param value value to store. Non-string values will be converted to a string via JSON.stringify
1132
1232
*/
1233
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1133
1234
function setOutput ( name , value ) {
1134
1235
command_1 . issueCommand ( 'set-output' , { name } , value ) ;
1135
1236
}
1136
1237
exports . setOutput = setOutput ;
1238
+ /**
1239
+ * Enables or disables the echoing of commands into stdout for the rest of the step.
1240
+ * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
1241
+ *
1242
+ */
1243
+ function setCommandEcho ( enabled ) {
1244
+ command_1 . issue ( 'echo' , enabled ? 'on' : 'off' ) ;
1245
+ }
1246
+ exports . setCommandEcho = setCommandEcho ;
1137
1247
//-----------------------------------------------------------------------
1138
1248
// Results
1139
1249
//-----------------------------------------------------------------------
@@ -1167,18 +1277,18 @@ function debug(message) {
1167
1277
exports . debug = debug ;
1168
1278
/**
1169
1279
* Adds an error issue
1170
- * @param message error issue message
1280
+ * @param message error issue message. Errors will be converted to string via toString()
1171
1281
*/
1172
1282
function error ( message ) {
1173
- command_1 . issue ( 'error' , message ) ;
1283
+ command_1 . issue ( 'error' , message instanceof Error ? message . toString ( ) : message ) ;
1174
1284
}
1175
1285
exports . error = error ;
1176
1286
/**
1177
1287
* Adds an warning issue
1178
- * @param message warning issue message
1288
+ * @param message warning issue message. Errors will be converted to string via toString()
1179
1289
*/
1180
1290
function warning ( message ) {
1181
- command_1 . issue ( 'warning' , message ) ;
1291
+ command_1 . issue ( 'warning' , message instanceof Error ? message . toString ( ) : message ) ;
1182
1292
}
1183
1293
exports . warning = warning ;
1184
1294
/**
@@ -1236,8 +1346,9 @@ exports.group = group;
1236
1346
* Saves state for current action, the state can only be retrieved by this action's post job execution.
1237
1347
*
1238
1348
* @param name name of the state to store
1239
- * @param value value to store
1349
+ * @param value value to store. Non-string values will be converted to a string via JSON.stringify
1240
1350
*/
1351
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1241
1352
function saveState ( name , value ) {
1242
1353
command_1 . issueCommand ( 'save-state' , { name } , value ) ;
1243
1354
}
@@ -1491,14 +1602,27 @@ module.exports = require("fs");
1491
1602
1492
1603
"use strict" ;
1493
1604
1605
+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
1606
+ if ( k2 === undefined ) k2 = k ;
1607
+ Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
1608
+ } ) : ( function ( o , m , k , k2 ) {
1609
+ if ( k2 === undefined ) k2 = k ;
1610
+ o [ k2 ] = m [ k ] ;
1611
+ } ) ) ;
1612
+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
1613
+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
1614
+ } ) : function ( o , v ) {
1615
+ o [ "default" ] = v ;
1616
+ } ) ;
1494
1617
var __importStar = ( this && this . __importStar ) || function ( mod ) {
1495
1618
if ( mod && mod . __esModule ) return mod ;
1496
1619
var result = { } ;
1497
- if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
1498
- result [ "default" ] = mod ;
1620
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . prototype . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
1621
+ __setModuleDefault ( result , mod ) ;
1499
1622
return result ;
1500
1623
} ;
1501
1624
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1625
+ exports . CocoapodsInstaller = void 0 ;
1502
1626
const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
1503
1627
const path = __importStar ( __webpack_require__ ( 622 ) ) ;
1504
1628
const os_1 = __webpack_require__ ( 87 ) ;
@@ -1561,11 +1685,23 @@ CocoapodsInstaller.podVersionRegex = /^COCOAPODS: ([\d.]+)$/i;
1561
1685
1562
1686
"use strict" ;
1563
1687
1688
+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
1689
+ if ( k2 === undefined ) k2 = k ;
1690
+ Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
1691
+ } ) : ( function ( o , m , k , k2 ) {
1692
+ if ( k2 === undefined ) k2 = k ;
1693
+ o [ k2 ] = m [ k ] ;
1694
+ } ) ) ;
1695
+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
1696
+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
1697
+ } ) : function ( o , v ) {
1698
+ o [ "default" ] = v ;
1699
+ } ) ;
1564
1700
var __importStar = ( this && this . __importStar ) || function ( mod ) {
1565
1701
if ( mod && mod . __esModule ) return mod ;
1566
1702
var result = { } ;
1567
- if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
1568
- result [ "default" ] = mod ;
1703
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . prototype . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
1704
+ __setModuleDefault ( result , mod ) ;
1569
1705
return result ;
1570
1706
} ;
1571
1707
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
@@ -1611,8 +1747,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1611
1747
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
1612
1748
} ) ;
1613
1749
} ;
1750
+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
1751
+ if ( mod && mod . __esModule ) return mod ;
1752
+ var result = { } ;
1753
+ if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
1754
+ result [ "default" ] = mod ;
1755
+ return result ;
1756
+ } ;
1614
1757
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1615
- const tr = __webpack_require__ ( 9 ) ;
1758
+ const tr = __importStar ( __webpack_require__ ( 9 ) ) ;
1616
1759
/**
1617
1760
* Exec a command.
1618
1761
* Output will be streamed to the live console.
0 commit comments