@@ -1220,13 +1220,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
12201220 return result ;
12211221} ;
12221222Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1223- exports . issueCommand = void 0 ;
1223+ exports . prepareKeyValueMessage = exports . issueFileCommand = void 0 ;
12241224// We use any as a valid input type
12251225/* eslint-disable @typescript-eslint/no-explicit-any */
12261226const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
12271227const os = __importStar ( __webpack_require__ ( 87 ) ) ;
1228+ const uuid_1 = __webpack_require__ ( 62 ) ;
12281229const utils_1 = __webpack_require__ ( 82 ) ;
1229- function issueCommand ( command , message ) {
1230+ function issueFileCommand ( command , message ) {
12301231 const filePath = process . env [ `GITHUB_${ command } ` ] ;
12311232 if ( ! filePath ) {
12321233 throw new Error ( `Unable to find environment variable for file command ${ command } ` ) ;
@@ -1238,7 +1239,22 @@ function issueCommand(command, message) {
12381239 encoding : 'utf8'
12391240 } ) ;
12401241}
1241- exports . issueCommand = issueCommand ;
1242+ exports . issueFileCommand = issueFileCommand ;
1243+ function prepareKeyValueMessage ( key , value ) {
1244+ const delimiter = `ghadelimiter_${ uuid_1 . v4 ( ) } ` ;
1245+ const convertedValue = utils_1 . toCommandValue ( value ) ;
1246+ // These should realistically never happen, but just in case someone finds a
1247+ // way to exploit uuid generation let's not allow keys or values that contain
1248+ // the delimiter.
1249+ if ( key . includes ( delimiter ) ) {
1250+ throw new Error ( `Unexpected input: name should not contain the delimiter "${ delimiter } "` ) ;
1251+ }
1252+ if ( convertedValue . includes ( delimiter ) ) {
1253+ throw new Error ( `Unexpected input: value should not contain the delimiter "${ delimiter } "` ) ;
1254+ }
1255+ return `${ key } <<${ delimiter } ${ os . EOL } ${ convertedValue } ${ os . EOL } ${ delimiter } ` ;
1256+ }
1257+ exports . prepareKeyValueMessage = prepareKeyValueMessage ;
12421258//# sourceMappingURL=file-command.js.map
12431259
12441260/***/ } ) ,
@@ -1719,7 +1735,11 @@ module.exports = require("timers");
17191735
17201736var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
17211737 if ( k2 === undefined ) k2 = k ;
1722- Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
1738+ var desc = Object . getOwnPropertyDescriptor ( m , k ) ;
1739+ if ( ! desc || ( "get" in desc ? ! m . __esModule : desc . writable || desc . configurable ) ) {
1740+ desc = { enumerable : true , get : function ( ) { return m [ k ] ; } } ;
1741+ }
1742+ Object . defineProperty ( o , k2 , desc ) ;
17231743} ) : ( function ( o , m , k , k2 ) {
17241744 if ( k2 === undefined ) k2 = k ;
17251745 o [ k2 ] = m [ k ] ;
@@ -1770,9 +1790,10 @@ function run() {
17701790 core . setFailed ( ".NET Core SDK is not available." ) ;
17711791 core . info ( "Please install with the following command in your YAML file:" ) ;
17721792 core . info ( "- name: Setup .NET Core" ) ;
1773- core . info ( " uses: actions/setup-dotnet@v1 " ) ;
1793+ core . info ( " uses: actions/setup-dotnet@v3 " ) ;
17741794 core . info ( " with" ) ;
1775- core . info ( " dotnet-version: '6.0.400'" ) ;
1795+ core . info ( " dotnet-version: 6.x" ) ;
1796+ core . info ( " dotnet-quality: 'ga'" ) ;
17761797 return ;
17771798 }
17781799 core . info ( "Detected .NET Core SDK version '" + output + "'" ) ;
@@ -2726,7 +2747,6 @@ const file_command_1 = __webpack_require__(102);
27262747const utils_1 = __webpack_require__ ( 82 ) ;
27272748const os = __importStar ( __webpack_require__ ( 87 ) ) ;
27282749const path = __importStar ( __webpack_require__ ( 622 ) ) ;
2729- const uuid_1 = __webpack_require__ ( 62 ) ;
27302750const oidc_utils_1 = __webpack_require__ ( 742 ) ;
27312751/**
27322752 * The code to exit an action
@@ -2756,20 +2776,9 @@ function exportVariable(name, val) {
27562776 process . env [ name ] = convertedVal ;
27572777 const filePath = process . env [ 'GITHUB_ENV' ] || '' ;
27582778 if ( filePath ) {
2759- const delimiter = `ghadelimiter_${ uuid_1 . v4 ( ) } ` ;
2760- // These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
2761- if ( name . includes ( delimiter ) ) {
2762- throw new Error ( `Unexpected input: name should not contain the delimiter "${ delimiter } "` ) ;
2763- }
2764- if ( convertedVal . includes ( delimiter ) ) {
2765- throw new Error ( `Unexpected input: value should not contain the delimiter "${ delimiter } "` ) ;
2766- }
2767- const commandValue = `${ name } <<${ delimiter } ${ os . EOL } ${ convertedVal } ${ os . EOL } ${ delimiter } ` ;
2768- file_command_1 . issueCommand ( 'ENV' , commandValue ) ;
2769- }
2770- else {
2771- command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
2779+ return file_command_1 . issueFileCommand ( 'ENV' , file_command_1 . prepareKeyValueMessage ( name , val ) ) ;
27722780 }
2781+ command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
27732782}
27742783exports . exportVariable = exportVariable ;
27752784/**
@@ -2787,7 +2796,7 @@ exports.setSecret = setSecret;
27872796function addPath ( inputPath ) {
27882797 const filePath = process . env [ 'GITHUB_PATH' ] || '' ;
27892798 if ( filePath ) {
2790- file_command_1 . issueCommand ( 'PATH' , inputPath ) ;
2799+ file_command_1 . issueFileCommand ( 'PATH' , inputPath ) ;
27912800 }
27922801 else {
27932802 command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
@@ -2827,7 +2836,10 @@ function getMultilineInput(name, options) {
28272836 const inputs = getInput ( name , options )
28282837 . split ( '\n' )
28292838 . filter ( x => x !== '' ) ;
2830- return inputs ;
2839+ if ( options && options . trimWhitespace === false ) {
2840+ return inputs ;
2841+ }
2842+ return inputs . map ( input => input . trim ( ) ) ;
28312843}
28322844exports . getMultilineInput = getMultilineInput ;
28332845/**
@@ -2860,8 +2872,12 @@ exports.getBooleanInput = getBooleanInput;
28602872 */
28612873// eslint-disable-next-line @typescript-eslint/no-explicit-any
28622874function setOutput ( name , value ) {
2875+ const filePath = process . env [ 'GITHUB_OUTPUT' ] || '' ;
2876+ if ( filePath ) {
2877+ return file_command_1 . issueFileCommand ( 'OUTPUT' , file_command_1 . prepareKeyValueMessage ( name , value ) ) ;
2878+ }
28632879 process . stdout . write ( os . EOL ) ;
2864- command_1 . issueCommand ( 'set-output' , { name } , value ) ;
2880+ command_1 . issueCommand ( 'set-output' , { name } , utils_1 . toCommandValue ( value ) ) ;
28652881}
28662882exports . setOutput = setOutput ;
28672883/**
@@ -2990,7 +3006,11 @@ exports.group = group;
29903006 */
29913007// eslint-disable-next-line @typescript-eslint/no-explicit-any
29923008function saveState ( name , value ) {
2993- command_1 . issueCommand ( 'save-state' , { name } , value ) ;
3009+ const filePath = process . env [ 'GITHUB_STATE' ] || '' ;
3010+ if ( filePath ) {
3011+ return file_command_1 . issueFileCommand ( 'STATE' , file_command_1 . prepareKeyValueMessage ( name , value ) ) ;
3012+ }
3013+ command_1 . issueCommand ( 'save-state' , { name } , utils_1 . toCommandValue ( value ) ) ;
29943014}
29953015exports . saveState = saveState ;
29963016/**
0 commit comments