1- import * as core from ' @actions/core' ;
2- import { getExecOutput } from ' @actions/exec' ;
1+ import * as core from " @actions/core" ;
2+ import { exec } from " @actions/exec" ;
33
4- async function runCmd ( cmd : string , ...args : string [ ] ) : Promise < string > {
5- const output = await getExecOutput ( cmd , args . length <= 0 ? undefined : args , {
6- silent : ! core . isDebug ( ) ,
7- } ) ;
8- return output . stdout ;
4+ async function runCmd ( cmd : string , ...args : string [ ] ) : Promise < void > {
5+ await exec ( cmd , args . length <= 0 ? undefined : args , { silent : ! core . isDebug ( ) } ) ;
96}
107
118async function main ( ) {
@@ -35,7 +32,8 @@ async function main() {
3532 args . push ( '--password' , password ) ;
3633 if ( storePasswordInCleartext ) args . push ( '--store-password-in-clear-text' ) ;
3734 }
38- if ( configFilePath ) args . push ( '--configfile' , configFilePath ) ;
35+ if ( configFilePath ) // noinspection SpellCheckingInspection
36+ args . push ( '--configfile' , configFilePath ) ;
3937 await runCmd ( 'dotnet' , ...args ) ;
4038 } ) ;
4139}
@@ -51,9 +49,8 @@ async function post() {
5149try {
5250 const isPost = ! ! core . getState ( 'isPost' ) ;
5351 // Mark the next run as post
54- if ( ! isPost ) core . saveState ( 'isPost' , 'true' )
55- if ( isPost ) post ( ) . catch ( ( error ) => core . setFailed ( error . message ) ) ;
56- else main ( ) . catch ( ( error ) => core . setFailed ( error . message ) ) ;
52+ if ( ! isPost ) core . saveState ( 'isPost' , 'true' ) ;
53+ ( isPost ? post ( ) : main ( ) ) . catch ( ( error ) => core . setFailed ( error . message ) ) ;
5754} catch ( error : any ) {
5855 core . setFailed ( error . message ) ;
5956}
0 commit comments