@@ -5165,17 +5165,24 @@ function octokitValidate(octokit) {
51655165
51665166"use strict" ;
51675167
5168+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
5169+ if ( mod && mod . __esModule ) return mod ;
5170+ var result = { } ;
5171+ if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
5172+ result [ "default" ] = mod ;
5173+ return result ;
5174+ } ;
51685175Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
5169- const os = __webpack_require__ ( 87 ) ;
5176+ const os = __importStar ( __webpack_require__ ( 87 ) ) ;
51705177/**
51715178 * Commands
51725179 *
51735180 * Command Format:
5174- * ##[ name key=value; key=value] message
5181+ * :: name key=value, key=value:: message
51755182 *
51765183 * Examples:
5177- * ##[ warning] This is the user warning message
5178- * ##[ set-secret name=mypassword]definitelyNotAPassword!
5184+ * :: warning:: This is the message
5185+ * :: set-env name=MY_VAR::some value
51795186 */
51805187function issueCommand ( command , properties , message ) {
51815188 const cmd = new Command ( command , properties , message ) ;
@@ -5200,34 +5207,39 @@ class Command {
52005207 let cmdStr = CMD_STRING + this . command ;
52015208 if ( this . properties && Object . keys ( this . properties ) . length > 0 ) {
52025209 cmdStr += ' ' ;
5210+ let first = true ;
52035211 for ( const key in this . properties ) {
52045212 if ( this . properties . hasOwnProperty ( key ) ) {
52055213 const val = this . properties [ key ] ;
52065214 if ( val ) {
5207- // safely append the val - avoid blowing up when attempting to
5208- // call .replace() if message is not a string for some reason
5209- cmdStr += `${ key } =${ escape ( `${ val || '' } ` ) } ,` ;
5215+ if ( first ) {
5216+ first = false ;
5217+ }
5218+ else {
5219+ cmdStr += ',' ;
5220+ }
5221+ cmdStr += `${ key } =${ escapeProperty ( val ) } ` ;
52105222 }
52115223 }
52125224 }
52135225 }
5214- cmdStr += CMD_STRING ;
5215- // safely append the message - avoid blowing up when attempting to
5216- // call .replace() if message is not a string for some reason
5217- const message = `${ this . message || '' } ` ;
5218- cmdStr += escapeData ( message ) ;
5226+ cmdStr += `${ CMD_STRING } ${ escapeData ( this . message ) } ` ;
52195227 return cmdStr ;
52205228 }
52215229}
52225230function escapeData ( s ) {
5223- return s . replace ( / \r / g, '%0D' ) . replace ( / \n / g, '%0A' ) ;
5231+ return ( s || '' )
5232+ . replace ( / % / g, '%25' )
5233+ . replace ( / \r / g, '%0D' )
5234+ . replace ( / \n / g, '%0A' ) ;
52245235}
5225- function escape ( s ) {
5226- return s
5236+ function escapeProperty ( s ) {
5237+ return ( s || '' )
5238+ . replace ( / % / g, '%25' )
52275239 . replace ( / \r / g, '%0D' )
52285240 . replace ( / \n / g, '%0A' )
5229- . replace ( / ] / g, '%5D ' )
5230- . replace ( / ; / g, '%3B ' ) ;
5241+ . replace ( / : / g, '%3A ' )
5242+ . replace ( / , / g, '%2C ' ) ;
52315243}
52325244//# sourceMappingURL=command.js.map
52335245
@@ -7203,10 +7215,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
72037215 step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
72047216 } ) ;
72057217} ;
7218+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
7219+ if ( mod && mod . __esModule ) return mod ;
7220+ var result = { } ;
7221+ if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
7222+ result [ "default" ] = mod ;
7223+ return result ;
7224+ } ;
72067225Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
72077226const command_1 = __webpack_require__ ( 431 ) ;
7208- const os = __webpack_require__ ( 87 ) ;
7209- const path = __webpack_require__ ( 622 ) ;
7227+ const os = __importStar ( __webpack_require__ ( 87 ) ) ;
7228+ const path = __importStar ( __webpack_require__ ( 622 ) ) ;
72107229/**
72117230 * The code to exit an action
72127231 */
@@ -7364,6 +7383,29 @@ function group(name, fn) {
73647383 } ) ;
73657384}
73667385exports . group = group ;
7386+ //-----------------------------------------------------------------------
7387+ // Wrapper action state
7388+ //-----------------------------------------------------------------------
7389+ /**
7390+ * Saves state for current action, the state can only be retrieved by this action's post job execution.
7391+ *
7392+ * @param name name of the state to store
7393+ * @param value value to store
7394+ */
7395+ function saveState ( name , value ) {
7396+ command_1 . issueCommand ( 'save-state' , { name } , value ) ;
7397+ }
7398+ exports . saveState = saveState ;
7399+ /**
7400+ * Gets the value of an state set by this action's main execution.
7401+ *
7402+ * @param name name of the state to get
7403+ * @returns string
7404+ */
7405+ function getState ( name ) {
7406+ return process . env [ `STATE_${ name } ` ] || '' ;
7407+ }
7408+ exports . getState = getState ;
73677409//# sourceMappingURL=core.js.map
73687410
73697411/***/ } ) ,
0 commit comments