@@ -28,8 +28,8 @@ actionsToolkit.run(
2828 await Docker . getExecOutput ( [ 'image' , 'inspect' , input . image ] , {
2929 ignoreReturnCode : true
3030 } ) . then ( res => {
31- if ( res . stderr . length > 0 && res . exitCode != 0 ) {
32- throw new Error ( res . stderr . match ( / ( . * ) \s * $ / ) ?. [ 0 ] ?. trim ( ) ?? 'unknown error' ) ;
31+ if ( res . exitCode != 0 ) {
32+ throw new Error ( `Failed to inspect image ${ input . image } : ${ Docker . getErrorMessage ( res . stderr ) } ` ) ;
3333 }
3434 } ) ;
3535 } ) ;
@@ -38,8 +38,8 @@ actionsToolkit.run(
3838 await Docker . getExecOutput ( [ 'run' , '--rm' , '--privileged' , input . image , '--version' ] , {
3939 ignoreReturnCode : true
4040 } ) . then ( res => {
41- if ( res . stderr . length > 0 && res . exitCode != 0 ) {
42- throw new Error ( res . stderr . match ( / ( . * ) \s * $ / ) ?. [ 0 ] ?. trim ( ) ?? 'unknown error' ) ;
41+ if ( res . exitCode != 0 ) {
42+ throw new Error ( `Failed to get binfmt version: ${ Docker . getErrorMessage ( res . stderr ) } ` ) ;
4343 }
4444 } ) ;
4545 } ) ;
@@ -49,8 +49,8 @@ actionsToolkit.run(
4949 await Docker . getExecOutput ( [ 'run' , '--rm' , '--privileged' , input . image , '--uninstall' , 'qemu-*' ] , {
5050 ignoreReturnCode : true
5151 } ) . then ( res => {
52- if ( res . stderr . length > 0 && res . exitCode != 0 ) {
53- throw new Error ( res . stderr . match ( / ( . * ) \s * $ / ) ?. [ 0 ] ?. trim ( ) ?? 'unknown error' ) ;
52+ if ( res . exitCode != 0 ) {
53+ throw new Error ( `Failed to uninstall current emulators: ${ Docker . getErrorMessage ( res . stderr ) } ` ) ;
5454 }
5555 } ) ;
5656 } ) ;
@@ -60,8 +60,8 @@ actionsToolkit.run(
6060 await Docker . getExecOutput ( [ 'run' , '--rm' , '--privileged' , input . image , '--install' , input . platforms ] , {
6161 ignoreReturnCode : true
6262 } ) . then ( res => {
63- if ( res . stderr . length > 0 && res . exitCode != 0 ) {
64- throw new Error ( res . stderr . match ( / ( . * ) \s * $ / ) ?. [ 0 ] ?. trim ( ) ?? 'unknown error' ) ;
63+ if ( res . exitCode != 0 ) {
64+ throw new Error ( `Failed to install QEMU static binaries: ${ Docker . getErrorMessage ( res . stderr ) } ` ) ;
6565 }
6666 } ) ;
6767 } ) ;
@@ -71,8 +71,8 @@ actionsToolkit.run(
7171 ignoreReturnCode : true ,
7272 silent : true
7373 } ) . then ( res => {
74- if ( res . stderr . length > 0 && res . exitCode != 0 ) {
75- throw new Error ( res . stderr . match ( / ( . * ) \s * $ / ) ?. [ 0 ] ?. trim ( ) ?? 'unknown error' ) ;
74+ if ( res . exitCode != 0 ) {
75+ throw new Error ( `Failed to extract available platforms: ${ Docker . getErrorMessage ( res . stderr ) } ` ) ;
7676 }
7777 const platforms : Platforms = JSON . parse ( res . stdout . trim ( ) ) ;
7878 core . info ( `${ platforms . supported . join ( ',' ) } ` ) ;
0 commit comments