File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,9 +108,9 @@ actionsToolkit.run(
108108 if ( inputs . call && inputs . call === 'check' && res . stdout . length > 0 ) {
109109 // checks warnings are printed to stdout: https://github.com/docker/buildx/pull/2647
110110 // take the first line with the message summaryzing the warnings
111- err = Error ( res . stdout . split ( '\n' ) [ 0 ] ?. trim ( ) ) ;
111+ err = new Error ( res . stdout . split ( '\n' ) [ 0 ] ?. trim ( ) ) ;
112112 } else if ( res . stderr . length > 0 ) {
113- err = Error ( `buildx failed with: ${ res . stderr . match ( / ( .* ) \s * $ / ) ?. [ 0 ] ?. trim ( ) ?? 'unknown error' } ` ) ;
113+ err = new Error ( `buildx failed with: ${ res . stderr . match ( / ( .* ) \s * $ / ) ?. [ 0 ] ?. trim ( ) ?? 'unknown error' } ` ) ;
114114 }
115115 }
116116 } ) ;
@@ -225,7 +225,11 @@ actionsToolkit.run(
225225 }
226226 if ( stateHelper . tmpDir . length > 0 ) {
227227 await core . group ( `Removing temp folder ${ stateHelper . tmpDir } ` , async ( ) => {
228- fs . rmSync ( stateHelper . tmpDir , { recursive : true } ) ;
228+ try {
229+ fs . rmSync ( stateHelper . tmpDir , { recursive : true } ) ;
230+ } catch ( e ) {
231+ core . warning ( `Failed to remove temp folder ${ stateHelper . tmpDir } ` ) ;
232+ }
229233 } ) ;
230234 }
231235 }
@@ -285,7 +289,7 @@ function buildRecordRetentionDays(): number | undefined {
285289 if ( val ) {
286290 const res = parseInt ( val ) ;
287291 if ( isNaN ( res ) ) {
288- throw Error ( `Invalid build record retention days: ${ val } ` ) ;
292+ throw new Error ( `Invalid build record retention days: ${ val } ` ) ;
289293 }
290294 return res ;
291295 }
You can’t perform that action at this time.
0 commit comments