@@ -554,7 +554,7 @@ class OidcClient {
554554 . catch ( error => {
555555 throw new Error ( `Failed to get ID Token. \n
556556 Error Code : ${ error . statusCode } \n
557- Error Message: ${ error . result . message } ` ) ;
557+ Error Message: ${ error . message } ` ) ;
558558 } ) ;
559559 const id_token = ( _a = res . result ) === null || _a === void 0 ? void 0 : _a . value ;
560560 if ( ! id_token ) {
@@ -4082,24 +4082,51 @@ const run = async () => {
40824082 const config = process . env . config ;
40834083
40844084 // check only deployment settings
4085- let deployOnly = process . env . function === 'true' ? 'function' : '' ;
4086- deployOnly += deployOnly === '' ? '' : ' ' ;
4087- deployOnly += process . env . hosting === 'true' ? `hosting` : '' ;
4085+ let deployList = [ ] ;
40884086
4089- let cmd = `firebase deploy -m ${ process . env . GITHUB_SHA } ` ;
4090- cmd += config ? ` --config ${ config } ` : ' ' ;
4091- cmd += ` --project ${ project } ` ;
4092- cmd += deployOnly !== '' ? ` --only ${ deployOnly } ` : '' ;
4087+ if ( process . env . function === 'true' ) {
4088+ deployList . push ( 'functions' ) ;
4089+ }
4090+
4091+ if ( process . env . hosting === 'true' ) {
4092+ deployList . push ( 'hosting' ) ;
4093+ }
4094+
4095+ let args = [ 'deploy' , '-m' , process . env . GITHUB_SHA , '--project' , project ] ;
4096+
4097+ if ( config ) {
4098+ args . push ( '--config' , config ) ;
4099+ }
4100+
4101+ if ( deployList . length > 0 ) {
4102+ args . push ( '--only' , deployList . join ( ',' ) ) ;
4103+ }
4104+
4105+ const options = { } ;
4106+ options . listeners = {
4107+ stdout : ( data ) => {
4108+ process . stdout . write ( data . toString ( ) ) ;
4109+ } ,
4110+ stderr : ( data ) => {
4111+ process . stderr . write ( data . toString ( ) ) ;
4112+ } ,
4113+ stdline : ( data ) => {
4114+ process . stdline . write ( data . toString ( ) ) ;
4115+ } ,
4116+ } ;
40934117
40944118 try {
40954119 // attempt to run firebase deploy, and run with debug mode if failed
4096- await _actions_exec__WEBPACK_IMPORTED_MODULE_1__ . exec ( cmd ) ;
4120+ await _actions_exec__WEBPACK_IMPORTED_MODULE_1__ . exec ( "firebase" , args , options ) ;
4121+
40974122 } catch ( error ) {
40984123 _actions_core__WEBPACK_IMPORTED_MODULE_0__ . error ( `An error occured while deploying to Firebase: ${ error } . Retrying with debug mode enabled ...` ) ;
40994124
41004125 // attempt to run firebase deploy with debug mode
4126+ args . push ( "--debug" ) ;
4127+
41014128 try {
4102- await _actions_exec__WEBPACK_IMPORTED_MODULE_1__ . exec ( ` ${ cmd } --debug` ) ;
4129+ await _actions_exec__WEBPACK_IMPORTED_MODULE_1__ . exec ( "firebase" , args , options ) ;
41034130 } catch ( error ) {
41044131 _actions_core__WEBPACK_IMPORTED_MODULE_0__ . setFailed ( `An error occured while deploying to Firebase: ${ error } ` ) ;
41054132 }
0 commit comments